upserve / docker-api

A lightweight Ruby client for the Docker Remote API
MIT License
1.09k stars 289 forks source link

undefined method `copy' on 2.0.0 #560

Closed ProxiBlue closed 4 years ago

ProxiBlue commented 4 years ago

Hello,

I use your code with a vagrant dev environment: https://github.com/ProxiBlue/vagrant_m2_vuestorefront

As of v 2.0.0, connection to docker instances fail with error: undefined method `copy' for #<Docker::Container:0x00000000034c0b50> (NoMethodError)

stack trace:

~/vagrant$ vagrant up redis
========================================================
domain : hussja.test
folder : /home/dedmeet/vagrant
mysql root password : root
persistent storage: /home/dedmeet/vagrant/persistent_storage
========================================================
Bringing machine 'redis' up with 'docker' provider...
==> redis: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines...
Traceback (most recent call last):
    63: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'
    62: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:201:in `action'
    61: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:201:in `call'
    60: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/environment.rb:613:in `lock'
    59: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:215:in `block in action'
    58: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/machine.rb:243:in `action_raw'
    57: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
    56: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
    55: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
    54: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
    53: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    52: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/delayed.rb:19:in `call'
    51: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    50: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/call.rb:53:in `call'
    49: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
    48: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
    47: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
    46: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
    45: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    44: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
    43: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    42: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
    41: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    40: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    39: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    38: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/plugins/providers/docker/action/host_machine.rb:18:in `call'
    37: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    36: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/call.rb:53:in `call'
    35: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
    34: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
    33: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
    32: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
    31: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    30: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
    29: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    28: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
    27: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    26: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/call.rb:53:in `call'
    25: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
    24: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
    23: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
    22: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
    21: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    20: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
    19: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    18: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/call.rb:53:in `call'
    17: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `run'
    16: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/util/busy.rb:19:in `busy'
    15: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/runner.rb:89:in `block in run'
    14: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builder.rb:149:in `call'
    13: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    12: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
    11: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
    10: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/provision.rb:80:in `call'
     9: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
     8: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
     7: from /opt/vagrant/embedded/gems/2.2.10/gems/vagrant-2.2.10/lib/vagrant/action/warden.rb:48:in `call'
     6: from /home/dedmeet/.vagrant.d/gems/2.6.6/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/action/update_all.rb:32:in `call'
     5: from /home/dedmeet/.vagrant.d/gems/2.6.6/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/action/update_all.rb:32:in `each'
     4: from /home/dedmeet/.vagrant.d/gems/2.6.6/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/action/update_all.rb:37:in `block in call'
     3: from /home/dedmeet/.vagrant.d/gems/2.6.6/gems/vagrant-hostmanager-1.8.9/lib/vagrant-hostmanager/hosts_file/updater.rb:37:in `update_guest'
     2: from /home/dedmeet/.vagrant.d/gems/2.6.6/gems/communicator-docker-1.0.5/lib/communicator-docker/communicator-docker.rb:72:in `download'
     1: from /home/dedmeet/.vagrant.d/gems/2.6.6/gems/communicator-docker-1.0.5/lib/communicator-docker/communicator-docker.rb:72:in `open'
/home/dedmeet/.vagrant.d/gems/2.6.6/gems/communicator-docker-1.0.5/lib/communicator-docker/communicator-docker.rb:73:in `block in download': undefined method `copy' for #<Docker::Container:0x00000000034c0b50> (NoMethodError)
~/vagrant$ vagrant plugin list
communicator-docker (1.0.5, global)
  - Version Constraint: 1.0.5
docker-api (2.0.0, global)
vagrant-hostmanager (1.8.9, global)

downgrading to 1.34.2 resolves issue

vagrant plugin list
communicator-docker (1.0.5, global)
  - Version Constraint: 1.0.5
docker-api (1.34.2, global)
vagrant-hostmanager (1.8.9, global)

Further info: The fail starts here:

https://github.com/ProxiBlue/vagrant-communicator-docker/blob/master/lib/communicator-docker/communicator-docker.rb#L73

(a docker communicator plugin for vagrant I wrote as a requirement to the dev env)

n-rodriguez commented 4 years ago

See Remove old copy method, replaced by archive_out : https://github.com/swipely/docker-api/commit/425036dd85e41f8d4e6ea95ee6d001d76af9c7d7

ProxiBlue commented 4 years ago

Thanks, should have gone look, but was to lazy. Bad me!