pulumi / pulumi-packet

A Pulumi provider for Packet
Apache License 2.0
8 stars 4 forks source link

Error with Packet API #86

Closed rawkode closed 4 years ago

rawkode commented 4 years ago

I'm using the packet typescript template and it is failing to contact the Packet API. I have confirmed that I can reach the Packet API via curl with my API key; so I'm not sure what's going on. The problem only seems to happen when using Pulumi.

    2020/07/20 19:19:00 [DEBUG] POST https://api.packet.net/projects
    2020/07/20 19:19:00 [ERR] POST https://api.packet.net/projects request failed: Post "https://api.packet.net/projects": dial tcp: lookup api.packet.net on [::1]:53: read udp [::1]:53620->[::1]:53: read: connection refused
    2020/07/20 19:19:00 [DEBUG] POST https://api.packet.net/projects: retrying in 1s (10 left)
    2020/07/20 19:19:01 [ERR] POST https://api.packet.net/projects request failed: Post "https://api.packet.net/projects": dial tcp: lookup api.packet.net on [::1]:53: read udp [::1]:41996->[::1]:53: read: connection refused
    2020/07/20 19:19:01 [DEBUG] POST https://api.packet.net/projects: retrying in 2s (9 left)
    2020/07/20 19:19:03 [ERR] POST https://api.packet.net/projects request failed: Post "https://api.packet.net/projects": dial tcp: lookup api.packet.net on [::1]:53: read udp [::1]:52127->[::1]:53: read: connection refused
    2020/07/20 19:19:03 [DEBUG] POST https://api.packet.net/projects: retrying in 4s (8 left)
    2020/07/20 19:19:07 [ERR] POST https://api.packet.net/projects request failed: Post "https://api.packet.net/projects": dial tcp: lookup api.packet.net on [::1]:53: read udp [::1]:49912->[::1]:53: read: connection refused
    2020/07/20 19:19:07 [DEBUG] POST https://api.packet.net/projects: retrying in 8s (7 left)
    2020/07/20 19:19:15 [ERR] POST https://api.packet.net/projects request failed: Post "https://api.packet.net/projects": dial tcp: lookup api.packet.net on [::1]:53: read udp [::1]:43212->[::1]:53: read: connection refused
    2020/07/20 19:19:15 [DEBUG] POST https://api.packet.net/projects: retrying in 16s (6 left)
    2020/07/20 19:19:31 [ERR] POST https://api.packet.net/projects request failed: Post "https://api.packet.net/projects": dial tcp: lookup api.packet.net on [::1]:53: read udp [::1]:52006->[::1]:53: read: connection refused
    2020/07/20 19:19:31 [DEBUG] POST https://api.packet.net/projects: retrying in 30s (5 left)

Curl does work:

❯ curl -H "X-Auth-Token: <redacted>" https://api.packet.net/projects | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   801  100   801    0     0    765      0  0:00:01  0:00:01 --:--:--   765
{
  "projects": [
    {
      "id": "<redacted>",
      "name": "<redacted>",
      "created_at": "2020-05-16T12:46:14Z",
      "updated_at": "2020-05-16T12:46:14Z",
      "backend_transfer_enabled": false,
      "customdata": {},
      "event_alert_configuration": null,
      "memberships": [],
leezen commented 4 years ago

The :53 in the trace suggests something going on with DNS. The Go resolver may not do exactly the same thing as your OS. Any chance you're on macOS?

leezen commented 4 years ago

And the possibly related issue - https://github.com/pulumi/pulumi/issues/4739

rawkode commented 4 years ago

I'm on Linux. I'll run some tests today 👍

leezen commented 4 years ago

@rawkode Thanks! Let us know what you find!

rawkode commented 4 years ago

I'm not really sure what's happening. Disabling systemd-networkd on my machine and using NetworkManager fixes it, but I don't know why. Closing this issue

🤷

leezen commented 4 years ago

Thanks for the update -- I haven't heard of that before either, but good to know you were able to get it working