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

dial tcp: lookup api.scaleway.com: i/o timeout #64

Closed
fredleger opened this issue Sep 26, 2022 · 8 comments
Closed

dial tcp: lookup api.scaleway.com: i/o timeout #64

fredleger opened this issue Sep 26, 2022 · 8 comments
Assignees
Labels

Comments

@fredleger
Copy link

Overview of the Issue

Got strange error about api timeout even if it seems to work when using curl

Reproduction Steps

packer build build_scaleway.pkr.hcl

Plugin and Packer version

1.8.3

Simplified Packer Buildfile

Using the provided exemple in this repo build_scaleway.pkr.hcl

Operating system and Environment details

MacOSX M1-pro Monterey
packer installed through asdf

Log Fragments and crash.log files

packer build build_scaleway.pkr.hcl
2022/09/26 18:10:58 [INFO] Packer version: 1.8.3 [go1.17.11 darwin arm64]
2022/09/26 18:10:58 Old default config directory found: /Users/frederic/.packer.d
2022/09/26 18:10:58 [TRACE] discovering plugins in /Users/frederic/.asdf/installs/packer/1.8.3/bin
2022/09/26 18:10:58 Old default config directory found: /Users/frederic/.packer.d
2022/09/26 18:10:58 [TRACE] discovering plugins in /Users/frederic/.packer.d/plugins
2022/09/26 18:10:58 [DEBUG] Discovered plugin: scaleway = /Users/frederic/.packer.d/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64
2022/09/26 18:10:58 [INFO] found external [-packer-default-plugin-name-] builders from scaleway plugin
2022/09/26 18:10:58 [TRACE] discovering plugins in .
2022/09/26 18:10:58 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/09/26 18:10:58 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/frederic/.packerconfig
2022/09/26 18:10:58 [WARN] Config file doesn't exist: /Users/frederic/.packerconfig
2022/09/26 18:10:58 Old default config directory found: /Users/frederic/.packer.d
2022/09/26 18:10:58 [INFO] Setting cache directory: /Users/frederic/.cache/packer
2022/09/26 18:10:58 Old default config directory found: /Users/frederic/.packer.d
2022/09/26 18:10:58 [TRACE] listing potential installations for "github.com/scaleway/scaleway" that match ">= 1.0.5". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/Users/frederic/.asdf/installs/packer/1.8.3/bin/packer", ".", "/Users/frederic/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"arm64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0x14000084100)}}}}
2022/09/26 18:10:58 [TRACE] Found the following "github.com/scaleway/scaleway" installations: [{/Users/frederic/.packer.d/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64 v1.0.6}]
2022/09/26 18:10:58 [INFO] found external [-packer-default-plugin-name-] builders from scaleway plugin
2022/09/26 18:10:58 [TRACE] Starting external plugin /Users/frederic/.packer.d/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64 start builder -packer-default-plugin-name-
2022/09/26 18:10:58 Starting plugin: /Users/frederic/.packer.d/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64 []string{"/Users/frederic/.packer.d/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64", "start", "builder", "-packer-default-plugin-name-"}
2022/09/26 18:10:58 Waiting for RPC address for: /Users/frederic/.packer.d/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64
2022/09/26 18:10:58 Received unix RPC address for /Users/frederic/.packer.d/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64: addr is /var/folders/n_/jtqch7ls28534bbt4hl905mr0000gn/T/packer-plugin2006929771
2022/09/26 18:10:58 packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64 plugin: 2022/09/26 18:10:58 Plugin address: unix /var/folders/n_/jtqch7ls28534bbt4hl905mr0000gn/T/packer-plugin2006929771
2022/09/26 18:10:58 packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64 plugin: 2022/09/26 18:10:58 Waiting for connection...
2022/09/26 18:10:58 packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64 plugin: 2022/09/26 18:10:58 Serving a plugin connection...
2022/09/26 18:10:58 packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64 plugin: 2022/09/26 18:10:58 [TRACE] starting builder -packer-default-plugin-name-
2022/09/26 18:10:58 packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64 plugin: 2022/09/26 18:10:58 Deprecation warning: Use SCALEWAY_ORGANIZATION environment variable and organization_id argument instead of api_access_key argument and SCALEWAY_API_ACCESS_KEY environment variable.
2022/09/26 18:10:58 Build debug mode: false
scaleway.basic: output will be in this color.

2022/09/26 18:10:58 Force build: false
2022/09/26 18:10:58 On error: 
2022/09/26 18:10:58 Waiting on builds to complete...
2022/09/26 18:10:58 Starting build run: scaleway.basic
2022/09/26 18:10:58 Running builder: 
2022/09/26 18:10:58 [INFO] (telemetry) Starting builder scaleway.basic
==> scaleway.basic: Prevalidating image name: basic build
2022/09/26 18:11:01 [ERR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/packer?arch=arm64&os=darwin&signature=e22a15bd-14da-807f-90f1-173bb4a873b5&version=1.8.3": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
==> scaleway.basic: error: getting image list: scaleway-sdk-go: error executing request: Get "https://api.scaleway.com/instance/v1/zones/fr-par-1/images?name=basic+build&page=1": dial tcp: lookup api.scaleway.com: i/o timeout
2022/09/26 18:11:03 [INFO] (telemetry) ending scaleway.basic
==> Wait completed after 5 seconds 2 milliseconds
2022/09/26 18:11:03 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/09/26 18:11:03 machine readable: scaleway.basic,error []string{"error: getting image list: scaleway-sdk-go: error executing request: Get \"https://api.scaleway.com/instance/v1/zones/fr-par-1/images?name=basic+build&page=1\": dial tcp: lookup api.scaleway.com: i/o timeout"}
==> Builds finished but no artifacts were created.
Build 'scaleway.basic' errored after 5 seconds 2 milliseconds: error: getting image list: scaleway-sdk-go: error executing request: Get "https://api.scaleway.com/instance/v1/zones/fr-par-1/images?name=basic+build&page=1": dial tcp: lookup api.scaleway.com: i/o timeout

==> Wait completed after 5 seconds 2 milliseconds

==> Some builds didn't complete successfully and had errors:
--> scaleway.basic: error: getting image list: scaleway-sdk-go: error executing request: Get "https://api.scaleway.com/instance/v1/zones/fr-par-1/images?name=basic+build&page=1": dial tcp: lookup api.scaleway.com: i/o timeout

==> Builds finished but no artifacts were created.
2022/09/26 18:11:03 [INFO] (telemetry) Finalizing.
2022/09/26 18:11:05 [WARN] (telemetry) Error finalizing report. This is safe to ignore. Post "https://checkpoint-api.hashicorp.com/v1/telemetry/packer": context deadline exceeded
2022/09/26 18:11:05 waiting for all plugin processes to complete...
2022/09/26 18:11:05 /Users/frederic/.packer.d/plugins/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.0.6_x5.0_darwin_arm64: plugin process exited
@fredleger fredleger added the bug label Sep 26, 2022
@Codelax
Copy link
Member

Codelax commented Sep 27, 2022

Hi, I tried with the same environment but I cannot reproduce. Seeing the error, it doesn't look like an issue with packer. You may have issues reaching scaleway's api.

@fredleger
Copy link
Author

It was what i was thinking too but doing more testing showed than not (cf screenshot bellow).
i tried in parallel to curl scw api and run packer. packer still have the issue even if curl to the api got only 200 http codes in return

image

@remyleone remyleone added the priority:high New features label Jan 31, 2023
@Codelax
Copy link
Member

Codelax commented Mar 31, 2023

To log scaleway request you can add SCW_DEBUG=true when showing packer debug.
But it might not help much if requests are not reaching, this could be an issue with golang dns resolver.
There was new versions of our packer plugin that use latest Go patches, it might fix it.

@mickaelperrin
Copy link

mickaelperrin commented Nov 17, 2023

It looks like the issue is still present:

2023/11/17 10:38:48 [INFO] (telemetry) Starting builder scaleway.base
==> scaleway.base: Prevalidating image name: image-packer-1700213928
==> scaleway.base: error: getting image list: scaleway-sdk-go: error executing request: Get "https://api.scaleway.com/instance/v1/zones/fr-par-2/images?name=image-packer-1700213928&page=1": dial tcp: lookup api.scaleway.com: i/o timeout
2023/11/17 10:38:53 [INFO] (telemetry) ending scaleway.base
==> Wait completed after 5 seconds 9 milliseconds
2023/11/17 10:38:53 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2023/11/17 10:38:53 machine readable: scaleway.base,error []string{"error: getting image list: scaleway-sdk-go: error executing request: Get \"https://api.scaleway.com/instance/v1/zones/fr-par-2/images?name=image-packer-1700213928&page=1\": dial tcp: lookup api.scaleway.com: i/o timeout"}
==> Builds finished but no artifacts were created.
2023/11/17 10:38:53 [INFO] (telemetry) Finalizing.
Build 'scaleway.base' errored after 5 seconds 9 milliseconds: error: getting image list: scaleway-sdk-go: error executing request: Get "https://api.scaleway.com/instance/v1/zones/fr-par-2/images?name=image-packer-1700213928&page=1": dial tcp: lookup api.scaleway.com: i/o timeout

==> Wait completed after 5 seconds 9 milliseconds

==> Some builds didn't complete successfully and had errors:
--> scaleway.base: error: getting image list: scaleway-sdk-go: error executing request: Get "https://api.scaleway.com/instance/v1/zones/fr-par-2/images?name=image-packer-1700213928&page=1": dial tcp: lookup api.scaleway.com: i/o timeout

==> Builds finished but no artifacts were created.
2023/11/17 10:38:54 waiting for all plugin processes to complete...
2023/11/17 10:38:54 /opt/homebrew/bin/github.com/scaleway/scaleway/packer-plugin-scaleway_v1.1.0_x5.0_darwin_arm64: plugin process exited

Doing the request with curl is working fine:

curl -X GET -H "X-Auth-Token: $SCW_SECRET_KEY" -H "ContentType: application/json" 'https://api.scaleway.com/instance/v1/zones/fr-par-2/images?name=image-packer-1700213928&page=1'
{"images": []}%

Versions:

  • packer version: v1.9.4 on macOS
  • go version go1.21.1 darwin/arm64

Running packer inside a docker container seems to work, but not the with the brew version

@fredleger
Copy link
Author

I tested it some times ago with a recent version of packer and it worked

@mickaelperrin
Copy link

@fredleger on macOS ?

@fredleger
Copy link
Author

Macos on mbp m1 pro

@fredleger
Copy link
Author

@mickaelperrin did you tried. I think this can be closed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants