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

Fallback to previous image if unable to download latest #683

Closed
abrooksv opened this issue Sep 26, 2018 · 1 comment
Closed

Fallback to previous image if unable to download latest #683

abrooksv opened this issue Sep 26, 2018 · 1 comment

Comments

@abrooksv
Copy link
Contributor

Description:

Steps to reproduce the issue:

  1. Turn off internet, run without ---skip-pull-image
  2. Crashes

Expected result:
If we have a cached image, SAM should use that and report that it failed to download the latest

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

Output of sam --version:
0.6.0

Optional Debug logs:

2018-09-26 16:07:50 Decompressing /var/folders/q5/cfv4k63519vcllnnpwz5zsj0wnjvck/T/5546671975416044841.zip
Traceback (most recent call last):
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/docker/api/client.py", line 229, in _raise_for_status
    response.raise_for_status()
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.35/images/create?tag=java8&fromImage=lambci%2Flambda

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/alfredbr/Library/Python/3.7/bin/sam", line 11, in <module>
    sys.exit(cli())
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/samcli/commands/local/invoke/cli.py", line 49, in cli
    docker_volume_basedir, docker_network, log_file, skip_pull_image, profile, region)  # pragma: no cover
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/samcli/commands/local/invoke/cli.py", line 90, in do_cli
    stderr=context.stderr)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/samcli/commands/local/lib/local_lambda.py", line 80, in invoke
    self.local_runtime.invoke(config, event, debug_context=self.debug_context, stdout=stdout, stderr=stderr)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/samcli/local/lambdafn/runtime.py", line 79, in invoke
    self._container_manager.run(container)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/samcli/local/docker/manager.py", line 53, in run
    self.pull_image(image_name)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/samcli/local/docker/manager.py", line 83, in pull_image
    result_itr = self.docker_client.api.pull(image_name, stream=True, decode=True)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/docker/api/image.py", line 399, in pull
    self._raise_for_status(response)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/docker/api/client.py", line 231, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/Users/alfredbr/Library/Python/3.7/lib/python/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("Get https://registry-1.docker.io/v2/: Service Unavailable")
@jfuss
Copy link
Contributor

jfuss commented Sep 27, 2018

Duplicate of #529 and #451

Closing

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

No branches or pull requests

2 participants