New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg #1135

Closed
zirkome opened this Issue Mar 19, 2015 · 54 comments

Comments

Projects
None yet
@zirkome

zirkome commented Mar 19, 2015

I installed docker-compose on my server I reconnect later it said :

Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

I have to reinstall it all the time :/

Thanks for your help!

@jasherai

This comment has been minimized.

Show comment
Hide comment
@jasherai

jasherai Mar 31, 2015

👍 I'm experiencing this too... not sure what extra info would be useful to help debug

jasherai commented Mar 31, 2015

👍 I'm experiencing this too... not sure what extra info would be useful to help debug

@funkyfuture

This comment has been minimized.

Show comment
Hide comment
@funkyfuture

funkyfuture Mar 31, 2015

Contributor

how have you installed it? what operating system are you using? what's the output of which docker-compose?

Contributor

funkyfuture commented Mar 31, 2015

how have you installed it? what operating system are you using? what's the output of which docker-compose?

@jasherai

This comment has been minimized.

Show comment
Hide comment
@jasherai

jasherai Apr 1, 2015

I've installed via the curl + chmod technique and I'm on ubuntu 14.10 (utopic). And output as requested...

pmehta@phaze:~$ which docker-compose
/usr/local/bin/docker-compose

jasherai commented Apr 1, 2015

I've installed via the curl + chmod technique and I'm on ubuntu 14.10 (utopic). And output as requested...

pmehta@phaze:~$ which docker-compose
/usr/local/bin/docker-compose
@zirkome

This comment has been minimized.

Show comment
Hide comment
@zirkome

zirkome Apr 2, 2015

I've installed docker-compose with curl and chmod method too on a CentOS 7.

$ which docker-compose                                                                                                                                              [19:24:40]
/usr/local/bin/docker-compose

zirkome commented Apr 2, 2015

I've installed docker-compose with curl and chmod method too on a CentOS 7.

$ which docker-compose                                                                                                                                              [19:24:40]
/usr/local/bin/docker-compose
@funkyfuture

This comment has been minimized.

Show comment
Hide comment
@funkyfuture

funkyfuture Apr 5, 2015

Contributor

does it work when you install compose with pip?

Contributor

funkyfuture commented Apr 5, 2015

does it work when you install compose with pip?

@hajaalin

This comment has been minimized.

Show comment
Hide comment
@hajaalin

hajaalin Apr 16, 2015

I had same problem, it was because of permissions. This helped:
sudo chmod a+rx /usr/local/bin/docker-compose

hajaalin commented Apr 16, 2015

I had same problem, it was because of permissions. This helped:
sudo chmod a+rx /usr/local/bin/docker-compose

@funkyfuture

This comment has been minimized.

Show comment
Hide comment
@funkyfuture

funkyfuture Apr 16, 2015

Contributor

@hajaalin that seems odd. which OS is that? how did you install it?

@jasherai we never had problem with an installation via pip on Ubuntu. and also python setup.py develop

Contributor

funkyfuture commented Apr 16, 2015

@hajaalin that seems odd. which OS is that? how did you install it?

@jasherai we never had problem with an installation via pip on Ubuntu. and also python setup.py develop

@hajaalin

This comment has been minimized.

Show comment
Hide comment
@hajaalin

hajaalin Apr 17, 2015

@funkyfuture I installed with curl and chmod method. This is Ubuntu 14.04.2, but not fully standard, the distro is maintained by our university. I don't know if there is some tweak that affects default file permissions, for example.

hajaalin commented Apr 17, 2015

@funkyfuture I installed with curl and chmod method. This is Ubuntu 14.04.2, but not fully standard, the distro is maintained by our university. I don't know if there is some tweak that affects default file permissions, for example.

@jasherai

This comment has been minimized.

Show comment
Hide comment
@jasherai

jasherai Apr 17, 2015

@funkyfuture I've been running the pip version of the install since your suggestion and it has been stable since. This seems specific to the curl method. I haven't tried the altered permissions that @hajaalin suggested so can't give feedback on that.

jasherai commented Apr 17, 2015

@funkyfuture I've been running the pip version of the install since your suggestion and it has been stable since. This seems specific to the curl method. I haven't tried the altered permissions that @hajaalin suggested so can't give feedback on that.

@djsly

This comment has been minimized.

Show comment
Hide comment
@djsly

djsly May 14, 2015

Same problem here

-bash-4.1$ docker-compose -p docker ps
Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
-bash-4.1$ sudo docker-compose -p docker ps
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg
-bash-4.1$ sudo docker-compose -p docker ps
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg
-bash-4.1$ which docker-compose
/usr/local/bin/docker-compose
-bash-4.1$ sudo which docker-compose
/usr/bin/docker-compose
-bash-4.1$ 
-bash-4.1$ 
-bash-4.1$ sudo cp /usr/local/bin/docker-compose /usr/bin/docker-compose
-bash-4.1$ sudo docker-compose -p docker ps
         Name                       Command               State                       Ports                      
----------------------------------------------------------------------------------------------------------------

djsly commented May 14, 2015

Same problem here

-bash-4.1$ docker-compose -p docker ps
Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
-bash-4.1$ sudo docker-compose -p docker ps
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg
-bash-4.1$ sudo docker-compose -p docker ps
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg
-bash-4.1$ which docker-compose
/usr/local/bin/docker-compose
-bash-4.1$ sudo which docker-compose
/usr/bin/docker-compose
-bash-4.1$ 
-bash-4.1$ 
-bash-4.1$ sudo cp /usr/local/bin/docker-compose /usr/bin/docker-compose
-bash-4.1$ sudo docker-compose -p docker ps
         Name                       Command               State                       Ports                      
----------------------------------------------------------------------------------------------------------------
@arangamani

This comment has been minimized.

Show comment
Hide comment
@arangamani

arangamani May 15, 2015

I have the same problem as well. I'm on Mac OSX.

arangamani commented May 15, 2015

I have the same problem as well. I'm on Mac OSX.

@frol

This comment has been minimized.

Show comment
Hide comment
@frol

frol May 19, 2015

Docker-compose requires not only x permission, but also r permission, so as @hajaalin pointed out sudo chmod +rx /usr/local/bin/docker-compose solves the issue. (Issue can be closed)

frol commented May 19, 2015

Docker-compose requires not only x permission, but also r permission, so as @hajaalin pointed out sudo chmod +rx /usr/local/bin/docker-compose solves the issue. (Issue can be closed)

@joestubbs

This comment has been minimized.

Show comment
Hide comment
@joestubbs

joestubbs May 28, 2015

Agree with @frol and @hajaalin -- adding read permission fixed the issue for me. Perhaps the documentation should be updated (https://docs.docker.com/compose/install/#install-compose) and this issue closed.

joestubbs commented May 28, 2015

Agree with @frol and @hajaalin -- adding read permission fixed the issue for me. Perhaps the documentation should be updated (https://docs.docker.com/compose/install/#install-compose) and this issue closed.

@sudhishkr

This comment has been minimized.

Show comment
Hide comment
@sudhishkr

sudhishkr Jul 2, 2015

I still have the issue, inspite of giving the read permission : chmod +rx /usr/bin/docker-compose

This doesn't solve the issue on OEL-6.5 (& higher) OS.

sudhishkr commented Jul 2, 2015

I still have the issue, inspite of giving the read permission : chmod +rx /usr/bin/docker-compose

This doesn't solve the issue on OEL-6.5 (& higher) OS.

@pendexgabo

This comment has been minimized.

Show comment
Hide comment
@pendexgabo

pendexgabo Jul 3, 2015

I'm experiencing the same issue on Centos 6.5...In my case the issue is worse because it doesn't consistently happens...meaning I usually can run docker-compose <command> several times and 1/10 times it fails...The only way to fix it is by downloading the script again using curl.

pendexgabo commented Jul 3, 2015

I'm experiencing the same issue on Centos 6.5...In my case the issue is worse because it doesn't consistently happens...meaning I usually can run docker-compose <command> several times and 1/10 times it fails...The only way to fix it is by downloading the script again using curl.

@lostsnow

This comment has been minimized.

Show comment
Hide comment
@lostsnow

lostsnow Jul 6, 2015

+1 for this issue.

I found the binary file has been changed(version 1.3.1)

# ls -l /usr/bin/docker-compose 
-rwxr-xr-x 1 root root 151325 Jun 26 09:37 /usr/bin/docker-compose

The correct file is:

# ls -l docker-compose-1.3.1
-rw-r--r-- 1 root root 8159297 Jun 23 09:28 docker-compose-1.3.1

lostsnow commented Jul 6, 2015

+1 for this issue.

I found the binary file has been changed(version 1.3.1)

# ls -l /usr/bin/docker-compose 
-rwxr-xr-x 1 root root 151325 Jun 26 09:37 /usr/bin/docker-compose

The correct file is:

# ls -l docker-compose-1.3.1
-rw-r--r-- 1 root root 8159297 Jun 23 09:28 docker-compose-1.3.1
@rocLv

This comment has been minimized.

Show comment
Hide comment
@rocLv

rocLv Jul 13, 2015

I'm experiencing the same issue on Ubuntu 14.04.

~ % uname -a
Linux i 3.13.0-57-lowlatency #95-Ubuntu SMP PREEMPT Fri Jun 19 09:45:24 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

ls -l /usr/local/bin/docker-compose 
-rwxr-xr-x 1 root root 6206256  7月 13 14:48 /usr/local/bin/docker-compose

I fixed this by downloading file from browser.
It just works.

rocLv commented Jul 13, 2015

I'm experiencing the same issue on Ubuntu 14.04.

~ % uname -a
Linux i 3.13.0-57-lowlatency #95-Ubuntu SMP PREEMPT Fri Jun 19 09:45:24 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

ls -l /usr/local/bin/docker-compose 
-rwxr-xr-x 1 root root 6206256  7月 13 14:48 /usr/local/bin/docker-compose

I fixed this by downloading file from browser.
It just works.

@wrenzi

This comment has been minimized.

Show comment
Hide comment
@wrenzi

wrenzi Aug 3, 2015

Same problem here. I need to reinstall docker-compose every time I reboot my server.

bash-4.1# docker-compose down
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

docker version

Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

docker info

Containers: 16
Images: 94
Storage Driver: devicemapper
 Pool Name: docker-253:2-132569-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 8.098 GB
 Data Space Total: 107.4 GB
 Data Space Available: 1.445 GB
 Metadata Space Used: 10.23 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 1.445 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.89-RHEL6 (2014-09-01)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 2.6.32-504.23.4.el6.x86_64
Operating System: <unknown>
CPUs: 4
Total Memory: 7.688 GiB
Name: docker-1.dev.infra
ID: Q7PJ:HLWI:OVH5:HC4B:YFM2:WTE2:HDI5:RVMQ:7CC5:PH6A:TGS5:7L76

wrenzi commented Aug 3, 2015

Same problem here. I need to reinstall docker-compose every time I reboot my server.

bash-4.1# docker-compose down
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

docker version

Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

docker info

Containers: 16
Images: 94
Storage Driver: devicemapper
 Pool Name: docker-253:2-132569-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 8.098 GB
 Data Space Total: 107.4 GB
 Data Space Available: 1.445 GB
 Metadata Space Used: 10.23 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 1.445 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.89-RHEL6 (2014-09-01)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 2.6.32-504.23.4.el6.x86_64
Operating System: <unknown>
CPUs: 4
Total Memory: 7.688 GiB
Name: docker-1.dev.infra
ID: Q7PJ:HLWI:OVH5:HC4B:YFM2:WTE2:HDI5:RVMQ:7CC5:PH6A:TGS5:7L76
@aanand

This comment has been minimized.

Show comment
Hide comment
@aanand

aanand Aug 3, 2015

Contributor

Nothing in the docker-compose binary would cause its permissions to be changed. Is something else on your system messing with the permissions of files in /usr/local/bin? I'm not familiar enough with Linux to know if this is a normal thing for distros to do.

Contributor

aanand commented Aug 3, 2015

Nothing in the docker-compose binary would cause its permissions to be changed. Is something else on your system messing with the permissions of files in /usr/local/bin? I'm not familiar enough with Linux to know if this is a normal thing for distros to do.

@pendexgabo

This comment has been minimized.

Show comment
Hide comment
@pendexgabo

pendexgabo Aug 3, 2015

This is pretty weird.

It seems that some process should be changing the permissions. What I end up doing was to set the immutable bit using chattr

so I did: chattr +i docker-compose and the prevented the issue from happening again.

remember removing the bit using chattr -i docker-compose if you need to update the binary again.

pendexgabo commented Aug 3, 2015

This is pretty weird.

It seems that some process should be changing the permissions. What I end up doing was to set the immutable bit using chattr

so I did: chattr +i docker-compose and the prevented the issue from happening again.

remember removing the bit using chattr -i docker-compose if you need to update the binary again.

@aanand

This comment has been minimized.

Show comment
Hide comment
@aanand

aanand Aug 3, 2015

Contributor

Anyone experiencing this issue, please tell us:

  1. Your operating system, distro, version etc.
  2. The output of ls -l /usr/local/bin/docker-compose immediately after following the install instructions
  3. The output of ls -l /usr/local/bin/docker-compose immediately after getting the Cannot open self error
Contributor

aanand commented Aug 3, 2015

Anyone experiencing this issue, please tell us:

  1. Your operating system, distro, version etc.
  2. The output of ls -l /usr/local/bin/docker-compose immediately after following the install instructions
  3. The output of ls -l /usr/local/bin/docker-compose immediately after getting the Cannot open self error
@wrenzi

This comment has been minimized.

Show comment
Hide comment
@wrenzi

wrenzi Aug 4, 2015

Hi @aanand, yesterday I tried to reboot my server but the problem didn't occur.

Today it happened again:

bash-4.1# uname -a
Linux docker-1.dev.infra 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 20:57:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
bash-4.1# ls -l /usr/local/bin/docker-compose
-rwxr-xr-x 1 root root 8182592 Aug  3 09:08 /usr/local/bin/docker-compose
bash-4.1# 
bash-4.1# 
bash-4.1# docker-compose -p myproject up -d
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg
bash-4.1# 
bash-4.1# 
bash-4.1# export HTTPS_PROXY=http://proxy-1.dev.infra:3128/
bash-4.1# curl -L https://github.com/docker/compose/releases/download/1.3.3/docker-compose-`uname -s`-`uname -m` > /usr//bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7990k  100 7990k    0     0  1450k      0  0:00:05  0:00:05 --:--:-- 2023k
bash-4.1# docker-compose -p myproject up -d
Creating myproject_mongodb_1...
Creating myproject_sga_1...
Creating myproject_oiapi_1...
Creating myproject_couchbase_1...
Creating myproject_oiauth_1...
Creating myproject_sac_1...
Creating myproject_activemq_1...
Creating myproject_oisender_1...
bash-4.1# ls -l /usr/local/bin/docker-compose
-rwxr-xr-x 1 root root 8182592 Aug  3 09:08 /usr/local/bin/docker-compose

We use Centos6. It could be the problem?

wrenzi commented Aug 4, 2015

Hi @aanand, yesterday I tried to reboot my server but the problem didn't occur.

Today it happened again:

bash-4.1# uname -a
Linux docker-1.dev.infra 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 20:57:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
bash-4.1# ls -l /usr/local/bin/docker-compose
-rwxr-xr-x 1 root root 8182592 Aug  3 09:08 /usr/local/bin/docker-compose
bash-4.1# 
bash-4.1# 
bash-4.1# docker-compose -p myproject up -d
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg
bash-4.1# 
bash-4.1# 
bash-4.1# export HTTPS_PROXY=http://proxy-1.dev.infra:3128/
bash-4.1# curl -L https://github.com/docker/compose/releases/download/1.3.3/docker-compose-`uname -s`-`uname -m` > /usr//bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7990k  100 7990k    0     0  1450k      0  0:00:05  0:00:05 --:--:-- 2023k
bash-4.1# docker-compose -p myproject up -d
Creating myproject_mongodb_1...
Creating myproject_sga_1...
Creating myproject_oiapi_1...
Creating myproject_couchbase_1...
Creating myproject_oiauth_1...
Creating myproject_sac_1...
Creating myproject_activemq_1...
Creating myproject_oisender_1...
bash-4.1# ls -l /usr/local/bin/docker-compose
-rwxr-xr-x 1 root root 8182592 Aug  3 09:08 /usr/local/bin/docker-compose

We use Centos6. It could be the problem?

@aanand

This comment has been minimized.

Show comment
Hide comment
@aanand

aanand Aug 4, 2015

Contributor

@wrenzi Your curl line looks strange:

bash-4.1# curl -L https://github.com/docker/compose/releases/download/1.3.3/docker-compose-`uname -s`-`uname -m` > /usr//bin/docker-compose

Looks like you downloaded it to /usr//bin/docker-compose? As you can see from the output of ls -l, the modification date of /usr/local/bin/docker-compose hasn't changed: it's "Aug 3 09:08" both before and after you ran curl.

Can you check the value of your PATH variable and the output of which docker-compose?

Contributor

aanand commented Aug 4, 2015

@wrenzi Your curl line looks strange:

bash-4.1# curl -L https://github.com/docker/compose/releases/download/1.3.3/docker-compose-`uname -s`-`uname -m` > /usr//bin/docker-compose

Looks like you downloaded it to /usr//bin/docker-compose? As you can see from the output of ls -l, the modification date of /usr/local/bin/docker-compose hasn't changed: it's "Aug 3 09:08" both before and after you ran curl.

Can you check the value of your PATH variable and the output of which docker-compose?

@wrenzi

This comment has been minimized.

Show comment
Hide comment
@wrenzi

wrenzi Aug 4, 2015

@aanand, you are right. I changed it because the /usr/local/bin/ was not in my $PATH (now it is)

I removed the installation and I installed it again in the default path:

bash-4.1# curl -L https://github.com/docker/compose/releases/download/1.3.3/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7990k  100 7990k    0     0  1535k      0  0:00:05  0:00:05 --:--:-- 2062k
bash-4.1# 
bash-4.1# chmod +x /usr/local/bin/docker-compose
bash-4.1# 
bash-4.1# which docker-compose
/usr/local/bin/docker-compose
bash-4.1# 
bash-4.1# ls -l /usr/local/bin/docker-compose
-rwxr-xr-x 1 root root 8182592 Aug  4 09:01 /usr/local/bin/docker-compose

If the problem occurs again I'll write here. Thank you very much.

wrenzi commented Aug 4, 2015

@aanand, you are right. I changed it because the /usr/local/bin/ was not in my $PATH (now it is)

I removed the installation and I installed it again in the default path:

bash-4.1# curl -L https://github.com/docker/compose/releases/download/1.3.3/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7990k  100 7990k    0     0  1535k      0  0:00:05  0:00:05 --:--:-- 2062k
bash-4.1# 
bash-4.1# chmod +x /usr/local/bin/docker-compose
bash-4.1# 
bash-4.1# which docker-compose
/usr/local/bin/docker-compose
bash-4.1# 
bash-4.1# ls -l /usr/local/bin/docker-compose
-rwxr-xr-x 1 root root 8182592 Aug  4 09:01 /usr/local/bin/docker-compose

If the problem occurs again I'll write here. Thank you very much.

@aanand

This comment has been minimized.

Show comment
Hide comment
@aanand

aanand Aug 4, 2015

Contributor

To anyone else experiencing the issue:

  1. Where are you installing docker-compose to?
  2. What's the output of echo $PATH and which docker-compose after it runs successfully?
  3. What's the output of echo $PATH and which docker-compose after you get the error?

This might be an issue with improperly configured PATH variables.

Contributor

aanand commented Aug 4, 2015

To anyone else experiencing the issue:

  1. Where are you installing docker-compose to?
  2. What's the output of echo $PATH and which docker-compose after it runs successfully?
  3. What's the output of echo $PATH and which docker-compose after you get the error?

This might be an issue with improperly configured PATH variables.

@lostsnow

This comment has been minimized.

Show comment
Hide comment
@lostsnow

lostsnow Aug 5, 2015

  1. Where are you installing docker-compose to?

    /usr/bin/docker-compose

  2. What's the output of echo $PATH and which docker-compose after it runs successfully?

    echo $PATH

    /usr/lib64/qt-3.3/bin:/usr/local/rvm/bin:/usr/local/subversion/bin:/usr/local/mysql/bin:/usr/local/xtrabackup/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

    which docker-compose

    /usr/bin/docker-compose

    docker-compose -v

    docker-compose version: 1.3.3
    CPython version: 2.7.9
    OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013

  3. What's the output of echo $PATH and which docker-compose after you get the error?

    echo $PATH

    /usr/lib64/qt-3.3/bin:/usr/local/rvm/bin:/usr/local/subversion/bin:/usr/local/mysql/bin:/usr/local/xtrabackup/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

    which docker-compose

    /usr/bin/docker-compose

    /usr/bin/docker-compose -v

    Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

lostsnow commented Aug 5, 2015

  1. Where are you installing docker-compose to?

    /usr/bin/docker-compose

  2. What's the output of echo $PATH and which docker-compose after it runs successfully?

    echo $PATH

    /usr/lib64/qt-3.3/bin:/usr/local/rvm/bin:/usr/local/subversion/bin:/usr/local/mysql/bin:/usr/local/xtrabackup/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

    which docker-compose

    /usr/bin/docker-compose

    docker-compose -v

    docker-compose version: 1.3.3
    CPython version: 2.7.9
    OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013

  3. What's the output of echo $PATH and which docker-compose after you get the error?

    echo $PATH

    /usr/lib64/qt-3.3/bin:/usr/local/rvm/bin:/usr/local/subversion/bin:/usr/local/mysql/bin:/usr/local/xtrabackup/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

    which docker-compose

    /usr/bin/docker-compose

    /usr/bin/docker-compose -v

    Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

@aanand

This comment has been minimized.

Show comment
Hide comment
@aanand

aanand Aug 5, 2015

Contributor

@lostsnow

  1. Why /usr/bin and not /usr/local/bin?
  2. What's the output of ls -l /usr/bin/docker-compose after running successfully?
  3. What's the output of ls -l /usr/bin/docker-compose after getting the error?
Contributor

aanand commented Aug 5, 2015

@lostsnow

  1. Why /usr/bin and not /usr/local/bin?
  2. What's the output of ls -l /usr/bin/docker-compose after running successfully?
  3. What's the output of ls -l /usr/bin/docker-compose after getting the error?
@lostsnow

This comment has been minimized.

Show comment
Hide comment
@lostsnow

lostsnow Aug 6, 2015

@aanand

  1. Why /usr/bin and not /usr/local/bin?

    I just put it here

  2. What's the output of ls -l /usr/bin/docker-compose after running successfully?

    ls -l /usr/bin/docker-compose

    -rwxr-xr-x 1 root root 8182592 Jul 31 16:35 /usr/bin/docker-compose

  3. What's the output of ls -l /usr/bin/docker-compose after getting the error?

    ls -l /usr/bin/docker-compose

    -rwxr-xr-x 1 root root 151325 Jul 28 09:59 /usr/bin/docker-compose

    The file has been changed, but I do not know why

lostsnow commented Aug 6, 2015

@aanand

  1. Why /usr/bin and not /usr/local/bin?

    I just put it here

  2. What's the output of ls -l /usr/bin/docker-compose after running successfully?

    ls -l /usr/bin/docker-compose

    -rwxr-xr-x 1 root root 8182592 Jul 31 16:35 /usr/bin/docker-compose

  3. What's the output of ls -l /usr/bin/docker-compose after getting the error?

    ls -l /usr/bin/docker-compose

    -rwxr-xr-x 1 root root 151325 Jul 28 09:59 /usr/bin/docker-compose

    The file has been changed, but I do not know why

@aanand

This comment has been minimized.

Show comment
Hide comment
@aanand

aanand Aug 6, 2015

Contributor

OK, then something on your system is changing the file. Nothing in Compose or the set of Docker tools would do that. Perhaps something that runs when you start a shell, or when you log in.

Contributor

aanand commented Aug 6, 2015

OK, then something on your system is changing the file. Nothing in Compose or the set of Docker tools would do that. Perhaps something that runs when you start a shell, or when you log in.

@dave-tucker

This comment has been minimized.

Show comment
Hide comment
@dave-tucker

dave-tucker Aug 6, 2015

Member

I've been doing some digging and have a theory.
To those that are experiencing this issue, can you verify that your system allows execution of files in /tmp?

A quick test...

touch /tmp/test.sh
vi /tmp/test.sh

#!/bin/bash
echo foo

chmod +x /tmp/test.sh
sh /tmp/test.sh

Looks like the way PyInstaller handles one-file executables is that it expands them in to /tmp and executes from there. In systems where this is restricted this type of executable won't work.

The workaround is to install using pip

Member

dave-tucker commented Aug 6, 2015

I've been doing some digging and have a theory.
To those that are experiencing this issue, can you verify that your system allows execution of files in /tmp?

A quick test...

touch /tmp/test.sh
vi /tmp/test.sh

#!/bin/bash
echo foo

chmod +x /tmp/test.sh
sh /tmp/test.sh

Looks like the way PyInstaller handles one-file executables is that it expands them in to /tmp and executes from there. In systems where this is restricted this type of executable won't work.

The workaround is to install using pip

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin Oct 26, 2015

Contributor

We've updated pyinstaller which may fix this issue. You can try it out by downloading a master build from https://dl.bintray.com/docker-compose/master/

The fix should also be in the 1.5.0 release.

Please let us know if the upgade fixed the issue. Thanks!

Contributor

dnephin commented Oct 26, 2015

We've updated pyinstaller which may fix this issue. You can try it out by downloading a master build from https://dl.bintray.com/docker-compose/master/

The fix should also be in the 1.5.0 release.

Please let us know if the upgade fixed the issue. Thanks!

@jlamillan

This comment has been minimized.

Show comment
Hide comment
@jlamillan

jlamillan Feb 3, 2016

Happened again to us using Docker compose version 1.6.0rc1 on RHEL release 6.6.

We installed docker-compose via curl as described here. (i.e. not pyInstaller)

bash-4.1$ docker-compose up -d Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

Compose version: 1.6.0rc1
Docker version: 1.9.1, build a34a1d5
OS info: Red Hat Enterprise Linux Server release 6.6 (Santiago)
Linux 3.8.13-44.1.1.el6uek.x86_64 #2 SMP Wed Sep 10 06:10:25 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux

bash-4.1$ echo $PATH /home/me/bin/:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/usr/bin:/usr/dev_infra/platform/bin:/usr/dev_infra/generic/bin:/usr/local/bin:/usr/X11R6/bin

bash-4.1$ which docker-compose /usr/bin/docker-compose

I kept a copy of the original (docker-compose.orig) when re-installing it the last time.

Corrupt version (much smaller):
bash-4.1$ ls -all /usr/bin/docker-compose -rwxr-xr-x 1 root root 38312 Jan 21 15:51 /usr/bin/docker-compose

Original version:
bash-4.1$ ls -all /usr/bin/docker-compose.orig -rw-r--r-- 1 root root 7934591 Jan 21 15:54 /usr/bin/docker-compose.orig

jlamillan commented Feb 3, 2016

Happened again to us using Docker compose version 1.6.0rc1 on RHEL release 6.6.

We installed docker-compose via curl as described here. (i.e. not pyInstaller)

bash-4.1$ docker-compose up -d Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

Compose version: 1.6.0rc1
Docker version: 1.9.1, build a34a1d5
OS info: Red Hat Enterprise Linux Server release 6.6 (Santiago)
Linux 3.8.13-44.1.1.el6uek.x86_64 #2 SMP Wed Sep 10 06:10:25 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux

bash-4.1$ echo $PATH /home/me/bin/:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/usr/bin:/usr/dev_infra/platform/bin:/usr/dev_infra/generic/bin:/usr/local/bin:/usr/X11R6/bin

bash-4.1$ which docker-compose /usr/bin/docker-compose

I kept a copy of the original (docker-compose.orig) when re-installing it the last time.

Corrupt version (much smaller):
bash-4.1$ ls -all /usr/bin/docker-compose -rwxr-xr-x 1 root root 38312 Jan 21 15:51 /usr/bin/docker-compose

Original version:
bash-4.1$ ls -all /usr/bin/docker-compose.orig -rw-r--r-- 1 root root 7934591 Jan 21 15:54 /usr/bin/docker-compose.orig

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin Feb 3, 2016

Contributor

The curl instructions are for the pyinstaller version.

It sounds like the download was incomplete, since the file size is wrong?

Contributor

dnephin commented Feb 3, 2016

The curl instructions are for the pyinstaller version.

It sounds like the download was incomplete, since the file size is wrong?

@garthy

This comment has been minimized.

Show comment
Hide comment
@garthy

garthy Feb 3, 2016

This is due to prelinking stripping of the zip file appended to the end of the file.

To reproduce run prelink on docker-compose.

This is done daily on OEL6 in /etc/cron.daily/prelink

The fix for this is to get pyinstaller to put the data in a elf section so it doesn't get thrown away

or disable prelinking of docker-compose

garthy commented Feb 3, 2016

This is due to prelinking stripping of the zip file appended to the end of the file.

To reproduce run prelink on docker-compose.

This is done daily on OEL6 in /etc/cron.daily/prelink

The fix for this is to get pyinstaller to put the data in a elf section so it doesn't get thrown away

or disable prelinking of docker-compose

@jlamillan

This comment has been minimized.

Show comment
Hide comment
@jlamillan

jlamillan Feb 3, 2016

Thanks Garth.

What you are saying sounds more like a workaround than a fix IMO.

jlamillan commented Feb 3, 2016

Thanks Garth.

What you are saying sounds more like a workaround than a fix IMO.

@garthy

This comment has been minimized.

Show comment
Hide comment
@garthy

garthy Feb 3, 2016

The disabling prelinking for docker-compose is a workaround.

Getting pyinstaller to produce a valid ELF file is the proper fix. I'll raise an issue with them tomorrow

garthy commented Feb 3, 2016

The disabling prelinking for docker-compose is a workaround.

Getting pyinstaller to produce a valid ELF file is the proper fix. I'll raise an issue with them tomorrow

@garthy

This comment has been minimized.

Show comment
Hide comment

garthy commented Feb 4, 2016

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin Feb 4, 2016

Contributor

Nice, thanks for tracking this down and opening the issue on pyinstaller!

Contributor

dnephin commented Feb 4, 2016

Nice, thanks for tracking this down and opening the issue on pyinstaller!

@jlamillan

This comment has been minimized.

Show comment
Hide comment
@jlamillan

jlamillan Feb 5, 2016

Yes, thanks again Garth.

jlamillan commented Feb 5, 2016

Yes, thanks again Garth.

@iamdey

This comment has been minimized.

Show comment
Hide comment
@iamdey

iamdey Feb 24, 2016

Hi, just this issue on my vps:

uname -a
Linux poc2 3.12.53-guest-43-4751b4a-x86_64 #2 SMP Mon Feb 1 15:04:40 UTC 2016 x86_64 GNU/Linux
 ls -l /usr/local/bin/docker-compose
-rwxr-xr-x 1 root staff 7925655 Feb 24 06:36 /usr/local/bin/docker-compose

I got this after trying to reinstall compose on a full drive with curl, here how I fixed it:

The error

# docker-compose
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

Happened with full disk

# df -h && du -h -d1 /var/lib/docker/devicemapper/devicemapper/data
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       9.8G  9.8G     0 100% /
...
8.6G    /var/lib/docker/devicemapper/devicemapper/data

so then

# docker rm `docker ps -aq`

still same error, reinstall docker-compose, problem solved for now

iamdey commented Feb 24, 2016

Hi, just this issue on my vps:

uname -a
Linux poc2 3.12.53-guest-43-4751b4a-x86_64 #2 SMP Mon Feb 1 15:04:40 UTC 2016 x86_64 GNU/Linux
 ls -l /usr/local/bin/docker-compose
-rwxr-xr-x 1 root staff 7925655 Feb 24 06:36 /usr/local/bin/docker-compose

I got this after trying to reinstall compose on a full drive with curl, here how I fixed it:

The error

# docker-compose
Cannot open self /usr/bin/docker-compose or archive /usr/bin/docker-compose.pkg

Happened with full disk

# df -h && du -h -d1 /var/lib/docker/devicemapper/devicemapper/data
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       9.8G  9.8G     0 100% /
...
8.6G    /var/lib/docker/devicemapper/devicemapper/data

so then

# docker rm `docker ps -aq`

still same error, reinstall docker-compose, problem solved for now

garthy added a commit to garthy/compose that referenced this issue May 10, 2016

Fixes #1135 - Use a new version of pyinstaller 3.2 to build a valid E…
…LF file to stop prelinking breaking compose

garthy added a commit to garthy/compose that referenced this issue May 12, 2016

Fixes #1135 - Use a new version of pyinstaller 3.2 to build a valid E…
…LF file to stop prelinking breaking compose

Signed-off-by: Garth Bushell <garth@garthy.com>
@robertkowalski

This comment has been minimized.

Show comment
Hide comment
@robertkowalski

robertkowalski Jul 20, 2016

we had the issue today on a travis ci vm we use for a private repo

robertkowalski commented Jul 20, 2016

we had the issue today on a travis ci vm we use for a private repo

@pmontrasio

This comment has been minimized.

Show comment
Hide comment
@pmontrasio

pmontrasio Sep 5, 2016

This is still broken on Ubuntu 16.04.

$ uname -a
Linux me 4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:   xenial
$ curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > docker-compose
$ ll docker-compose
-rw-rw-r-- 1 me me 7970402 Sep  5 10:37 docker-compose
$ sudo mv docker-compose /usr/local/bin/docker-compose
$ chmod 755 /usr/local/bin/docker-compose
$ ll /usr/local/bin/docker-compose
-rwxr-xr-x 1 me me 7970402 Sep  5 10:37 /usr/local/bin/docker-compose*
$ docker-compose
Cannot open self /usr/local/bin/docker-compose or archive /usr/local/bin/docker-compose.pkg

Installing with sudo pip install docker-compose works.

Maybe you should drop the curl installation and require pip. Alternatively, advise to use pip as the preferred method and move curl to the alternative installation methods, with a link to this issue. Both solutions are going to save time to many people.

Just in case it would need a writable /usr/local/bin similarly to what you suggest to do to make the download easier, that's against any security guideline. I didn't even attempt it.

pmontrasio commented Sep 5, 2016

This is still broken on Ubuntu 16.04.

$ uname -a
Linux me 4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:   xenial
$ curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > docker-compose
$ ll docker-compose
-rw-rw-r-- 1 me me 7970402 Sep  5 10:37 docker-compose
$ sudo mv docker-compose /usr/local/bin/docker-compose
$ chmod 755 /usr/local/bin/docker-compose
$ ll /usr/local/bin/docker-compose
-rwxr-xr-x 1 me me 7970402 Sep  5 10:37 /usr/local/bin/docker-compose*
$ docker-compose
Cannot open self /usr/local/bin/docker-compose or archive /usr/local/bin/docker-compose.pkg

Installing with sudo pip install docker-compose works.

Maybe you should drop the curl installation and require pip. Alternatively, advise to use pip as the preferred method and move curl to the alternative installation methods, with a link to this issue. Both solutions are going to save time to many people.

Just in case it would need a writable /usr/local/bin similarly to what you suggest to do to make the download easier, that's against any security guideline. I didn't even attempt it.

@Zlo

This comment has been minimized.

Show comment
Hide comment
@Zlo

Zlo Oct 13, 2016

On Ubuntu 14.04, any installer that strips the binary will break it. It will truncate it to a 29680 byte file and will result in the error message shown in the subject.

Zlo commented Oct 13, 2016

On Ubuntu 14.04, any installer that strips the binary will break it. It will truncate it to a 29680 byte file and will result in the error message shown in the subject.

@fae88

This comment has been minimized.

Show comment
Hide comment
@fae88

fae88 Nov 22, 2016

same problem
but I could not find a certain useful answer to solve it

#docker-compose
Cannot open self /usr/local/bin/docker-compose or archive /usr/local/bin/docker-compose.pkg

yeah, i have solved this problem now! you can do like this.

do not use the command line
curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-uname -s-uname -m > /usr/local/bin/docker-compose
to download, maybe this makes it too slow to download.

choose the way of downloading the file ,
visit this https://github.com/docker/compose/releases website and choose file to download
docker-compose-Linux-x86_64 7.67 MB
docker-compose-Windows-x86_64.exe 5.97 MB
then rename as docker-compose and copy into /usr/local/bin/

that's OK.

now you can use docker-compose --version to test whether your docker-compose is installed

fae88 commented Nov 22, 2016

same problem
but I could not find a certain useful answer to solve it

#docker-compose
Cannot open self /usr/local/bin/docker-compose or archive /usr/local/bin/docker-compose.pkg

yeah, i have solved this problem now! you can do like this.

do not use the command line
curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-uname -s-uname -m > /usr/local/bin/docker-compose
to download, maybe this makes it too slow to download.

choose the way of downloading the file ,
visit this https://github.com/docker/compose/releases website and choose file to download
docker-compose-Linux-x86_64 7.67 MB
docker-compose-Windows-x86_64.exe 5.97 MB
then rename as docker-compose and copy into /usr/local/bin/

that's OK.

now you can use docker-compose --version to test whether your docker-compose is installed

@sandokandias

This comment has been minimized.

Show comment
Hide comment
@sandokandias

sandokandias Dec 15, 2016

Same problem, but works by pip.

SO: Fedora 25
Linux localhost.localdomain 4.8.12-300.fc25.x86_64 #1 SMP Fri Dec 2 17:52:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

sandokandias commented Dec 15, 2016

Same problem, but works by pip.

SO: Fedora 25
Linux localhost.localdomain 4.8.12-300.fc25.x86_64 #1 SMP Fri Dec 2 17:52:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

@ThomasWaldmann

This comment has been minimized.

Show comment
Hide comment

@shin- shin- added this to the 1.11.0 milestone Jan 30, 2017

@shin- shin- closed this in #3558 Feb 6, 2017

@Tan-Tshunglee

This comment has been minimized.

Show comment
Hide comment
@Tan-Tshunglee

Tan-Tshunglee Apr 6, 2017

Same problem, reason is curl download was incomplete. And no error output!!!

Tan-Tshunglee commented Apr 6, 2017

Same problem, reason is curl download was incomplete. And no error output!!!

@xavierholt

This comment has been minimized.

Show comment
Hide comment
@xavierholt

xavierholt May 5, 2017

Ran into this while packaging docker-compose-1.5.2 as an RPM for CentOS 6. Turns out the rpmbuild command has a default strip step at __os_install_post. I "fixed" it by adding this line at the top of my RPM spec:

%global __os_install_post %{nil}

You can find a little more info on RPM stripping - and other ways to disable it - at http://livecipher.blogspot.com/2012/06/disable-binary-stripping-in-rpmbuild.html

xavierholt commented May 5, 2017

Ran into this while packaging docker-compose-1.5.2 as an RPM for CentOS 6. Turns out the rpmbuild command has a default strip step at __os_install_post. I "fixed" it by adding this line at the top of my RPM spec:

%global __os_install_post %{nil}

You can find a little more info on RPM stripping - and other ways to disable it - at http://livecipher.blogspot.com/2012/06/disable-binary-stripping-in-rpmbuild.html

@OrDuan

This comment has been minimized.

Show comment
Hide comment
@OrDuan

OrDuan Sep 13, 2017

Same problem, I just download it from github, followed by @fae88 instructions, I had to run this command to solve permissions issue:

sudo chmod +x /usr/local/bin/docker-compose

OrDuan commented Sep 13, 2017

Same problem, I just download it from github, followed by @fae88 instructions, I had to run this command to solve permissions issue:

sudo chmod +x /usr/local/bin/docker-compose

@tianhaoo

This comment has been minimized.

Show comment
Hide comment
@tianhaoo

tianhaoo Jan 30, 2018

Same problem, but I just reinstall it, then it work fine.

tianhaoo commented Jan 30, 2018

Same problem, but I just reinstall it, then it work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment