Pipelines cant run command through ssh

Rafael Soufraz April 3, 2018

I have a file into a server and I'd like to run this file through ssh.

From my machine it works perfectly. Here the output:

$ ssh rafael@alpha.serveraddress.com.br -p 22123 "./project-update.sh"
From bitbucket.org:Company/project
* branch alpha -> FETCH_HEAD
Already up-to-date.
docker-compose exec php-fpm ./composer_vendor/bin/phinx migrate -e local
Phinx by Rob Morgan - https://phinx.org. 0.6.6

using config file ./phinx.php
using config parser php
using migration path db/migrations
using seed path db/seeds/views
using environment local
using adapter mysql
using database project

All Done. Took 0.1000s

When the bitbucket pipelines try to run, this is the output:

ssh rafael@alpha.serveraddress.com.br -p 22123 "./project-update.sh"
Warning: Permanently added the RSA host key for IP address '[178.88.88.188]:22123' to the list of known hosts.
From bitbucket.org:Company/project
* branch alpha -> FETCH_HEAD
Already up-to-date.
docker-compose exec php-fpm ./composer_vendor/bin/phinx migrate -e local
Traceback (most recent call last):
File "bin/docker-compose", line 6, in <module>
File "compose/cli/main.py", line 71, in main
File "compose/cli/main.py", line 124, in perform_command
File "compose/cli/main.py", line 467, in exec_command
File "site-packages/dockerpty/pty.py", line 338, in start
File "site-packages/dockerpty/io.py", line 32, in set_blocking
ValueError: file descriptor cannot be a negative integer (-1)
Failed to execute script docker-compose
make: *** [phinx-migrate] Error 255
Makefile:38: recipe for target 'phinx-migrate' failed

 What is happend? Am I forgetting some configuration?

1 answer

0 votes
Kurt Klinner
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2018

@Rafael Soufraz

 

Hi Rafael,

could be docker related. I had a similar issue in the past andcould get it to work by adding the -T parameter to not create a Pseudo-TTY.

docker-compose exec -T container_name ./build.sh for example.

 

BR

Kurt

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events