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

LXD containers are not injected http(s)_proxy variables if those are set to the host #528

Open
skatsaounis opened this issue Mar 7, 2024 · 3 comments
Labels
Bug Something isn't working

Comments

@skatsaounis
Copy link

Bug Description

I am trying to run rockcraft pack from a system that is running behind a corporate http_proxy. The command fails to run since skopeo is trying to fetch a base ubuntu OCI image from AWS registry and it timeouts. The reason is that the LXD container being created by this project is not injected with proxy variables when those are set to the host. At the same time, this project here is taking care of snap behind proxy scenarios.

To Reproduce

Install rockcraft in a machine behind an http_proxy and then try to run rockcraft pack with any rockcraft.yaml

part yaml

No response

Relevant log output

ailed to copy image: Command '['/snap/rockcraft/1628/bin/skopeo', '--insecure-policy', '--override-arch', 'amd64', 'copy', '--retry-times', '5', 'docker://public.ecr.aws/ubuntu/ubuntu:22.04', 'oci:/root/images/ubuntu:22.04']' returned non-zero exit status 1. (time="2024-03-07T10:24:50Z" level=warning msg="Failed, retrying in 1s ... (1/5). Error: initializing source docker://public.ecr.aws/ubuntu/ubuntu:22.04: pinging container registry public.ecr.aws: Get \"https://public.ecr.aws/v2/\": dial tcp 99.83.145.10:443: i/o timeout"
time="2024-03-07T10:25:51Z" level=warning msg="Failed, retrying in 2s ... (2/5). Error: initializing source docker://public.ecr.aws/ubuntu/ubuntu:22.04: pinging container registry public.ecr.aws: Get \"https://public.ecr.aws/v2/\": dial tcp 75.2.101.78:443: i/o timeout"
time="2024-03-07T10:26:53Z" level=warning msg="Failed, retrying in 4s ... (3/5). Error: initializing source docker://public.ecr.aws/ubuntu/ubuntu:22.04: pinging container registry public.ecr.aws: Get \"https://public.ecr.aws/v2/\": dial tcp 99.83.145.10:443: i/o timeout"
time="2024-03-07T10:27:57Z" level=warning msg="Failed, retrying in 8s ... (4/5). Error: initializing source docker://public.ecr.aws/ubuntu/ubuntu:22.04: pinging container registry public.ecr.aws: Get \"https://public.ecr.aws/v2/\": dial tcp 75.2.101.78:443: i/o timeout"
time="2024-03-07T10:29:05Z" level=warning msg="Failed, retrying in 16s ... (5/5). Error: initializing source docker://public.ecr.aws/ubuntu/ubuntu:22.04: pinging container registry public.ecr.aws: Get \"https://public.ecr.aws/v2/\": dial tcp 99.83.145.10:443: i/o timeout"
time="2024-03-07T10:30:21Z" level=fatal msg="initializing source docker://public.ecr.aws/ubuntu/ubuntu:22.04: pinging container registry public.ecr.aws: Get \"https://public.ecr.aws/v2/\": dial tcp 99.83.145.10:443: i/o timeout")                                                 
Failed to execute rockcraft in instance.
@skatsaounis skatsaounis added the Bug Something isn't working label Mar 7, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2578.

This message was autogenerated

@mr-cal
Copy link
Collaborator

mr-cal commented Mar 7, 2024

Craft-application has an opportunity to provide environment variables to craft-providers here. We should probably upstream this code from snapcraft into craft-application.

Snapcraft accepts --http-proxy and --https-proxy but not --no-proxy for reasons unknown. Should these parameters be upstreamed too?

@lengau
Copy link
Contributor

lengau commented Mar 12, 2024

This is included in craft-application 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants