Skip to content
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

Warning: local() encountered an error (return code 1) #178

Closed
Dmdv opened this issue Apr 23, 2018 · 4 comments
Closed

Warning: local() encountered an error (return code 1) #178

Dmdv opened this issue Apr 23, 2018 · 4 comments

Comments

@Dmdv
Copy link

Dmdv commented Apr 23, 2018

Hi, what could the source of the problem?
Beating the head against a wall

Fabric==1.14.0
fabricio==0.3.1

local: docker build --tag front:latest --pull --build-arg nginx_config_filename=local.conf .
Sending build context to Docker daemon 436.6MB
Step 1/15 : FROM centos:centos7
Get https://registry-1.docker.io/v2/: EOF

Warning: local() encountered an error (return code 1) while executing 'docker build --tag front:latest --pull --build-arg nginx_config_filename=local.conf .'

Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/fabric/main.py", line 757, in main
*args, **kwargs
File "/usr/local/lib/python2.7/site-packages/fabric/tasks.py", line 426, in execute
results[''] = task.run(*args, **new_kwargs)
File "/usr/local/lib/python2.7/site-packages/fabric/tasks.py", line 173, in run
return self.wrapped(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/fabricio/tasks.py", line 368, in deploy
fab.execute(self.prepare, tag=tag, no_cache=no_cache)
File "/usr/local/lib/python2.7/site-packages/fabric/tasks.py", line 426, in execute
results[''] = task.run(*args, **new_kwargs)
File "/usr/local/lib/python2.7/site-packages/fabric/tasks.py", line 173, in run
return self.wrapped(*args, **kwargs)
File "/Users/myusername/Develop/chat-bot/frontend/fabfile.py", line 206, in prepare
use_cache=True,
File "/usr/local/lib/python2.7/site-packages/fabricio/init.py", line 74, in local
**kwargs
File "/usr/local/lib/python2.7/site-packages/fabricio/init.py", line 27, in _command
raise RuntimeError(result)
RuntimeError

@renskiy
Copy link
Owner

renskiy commented Apr 23, 2018

I suppose your build image command ends up with an error. I’m not sure why you don’t see this error, maybe because of capture=True.

Try to execute image build command without Fabricio. You should see error message at least.

@Dmdv
Copy link
Author

Dmdv commented Apr 23, 2018

@renskiy
It fails with this task:

class FrontTasks(tasks.BuildDockerTasks):

    @fab.task(task_class=tasks.IgnoreHostsTask)
    def prepare(self, tag=None, no_cache=False):
        """
        prepare Docker image
        """
        options = Options([
            ('tag', str(self.image[tag])),
            ('no-cache', strtobool(no_cache)),
            ('pull', True),
            ('build-arg', 'nginx_config_filename=%s' % fab.env.get('nginx_config_filename', ''))
        ])
        fabricio.local(
            'docker build {options} {build_path}'.format(
                build_path=self.build_path,
                options=options,
            ),
            quiet=False,
            use_cache=True,
        )
        self.remove_obsolete_images()

This line:

use_cache=True,

@Dmdv
Copy link
Author

Dmdv commented Apr 23, 2018

It seems you mean to build an image with docker build

@Dmdv
Copy link
Author

Dmdv commented Apr 23, 2018

Problem solved with local building the image from the console and the problem that I see is using a cache

@Dmdv Dmdv closed this as completed Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants