#dagger and terraform

1 messages · Page 1 of 1 (latest)

radiant fog
#

Hi,
I'm trying to use terraform with dagger but i'm getting ranmdom EOF error when it downloads providers

#2 10.19 │ Error: Cannot download provider release
#2 10.19 │
#2 10.19 │ Failed to download registry.terraform.io/hashicorp/aws v4.53.0 for
#2 10.19 │ linux_amd64: unexpected EOF.
#2 10.19 ╵
#2 10.19
#2 10.19 ╷
#2 10.19 │ Error: Cannot download provider release
#2 10.19 │
#2 10.19 │ Failed to download registry.terraform.io/hashicorp/null v3.2.1 for
#2 10.19 │ linux_amd64: unexpected EOF.

It is not the same output every time i retried.
I think it has something to do with my local setup of dagger as i :

  • cannot reproduce it on the playground
  • it works outside of dagger
    But i can't find the root cause 😦
humble timber
#

👀

humble timber
#

@radiant fog what dagger SDK and version are you using?

#

we're seeing some other EOF errors particularly after the go 1.20 release. Trying to see if that's related somehow

radiant fog
#

python sdk 0.3.1

#

with the 3.10 engien and also i tried the main branch

humble timber
#

👍 cc @autumn falcon maybe you can help me troubleshooting here?

radiant fog
#

Directly tried whith the CLI :

#!/bin/bash

id=$(dagger query <<EOF | jq -r .http.id
query {
  http(url:"https://raw.githubusercontent.com/inpulse-tv/EP34-wasi/main/deploy/tf/terraform.tf") {
    id
  }
}
EOF
)

echo $id


id=$(dagger query <<EOF | jq -r .http.id
query {
  container {
    from(address: "hashicorp/terraform:latest") {
      withFile(path:"terraform.tf", source:"$id") {
        withExec(args: ["init"]) {
          stdout
        }
      }
    }
  }
}
EOF
)
#

same error

╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/null v3.2.1: unexpected EOF
╵

╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/aws v4.53.0: unexpected EOF
╵

╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/helm v2.8.0: unexpected EOF
╵

╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/kubernetes v2.17.0: unexpected EOF
humble timber
#

@radiant fog does it happen randomly? or all the time?

#

have you tried removing your dagger engine container? Sometimes we notice that the networking gets borked randomly

docker rm -f $(docker ps --filter name=dagger-engine -q)

radiant fog
#

It fails all the time, but not on all provider. Sometime it's aws, sometimes it's sacleway, sometime multiple at the same time

humble timber
#

can you try adding TF_LOG=DEBUG env variable to your run to see if we can see something there?

#

seems to me that it seems to be some networking issue in the build container for some reason

radiant fog
#

debug show info when it succeeded to download provider

2023-02-06T16:25:25.610Z [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/local/2.3.0/download/linux/amd64
2023-02-06 17:25:29 2023-02-06T16:25:25.674Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-local/2.3.0/terraform-provider-local_2.3.0_SHA256SUMS
2023-02-06 17:25:29 2023-02-06T16:25:25.728Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-local/2.3.0/terraform-provider-local_2.3.0_SHA256SUMS.72D7468F.sig
2023-02-06 17:25:29 2023-02-06T16:25:27.025Z [DEBUG] Provider signed by 34365D9472D7468F HashiCorp Security (hashicorp.com/security) <security@hashicorp.com>
2023-02-06 17:25:29 2023-02-06T16:25:27.302Z [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/null/3.2.1/download/linux/amd64
2023-02-06 17:25:29 2023-02-06T16:25:27.406Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-null/3.2.1/terraform-provider-null_3.2.1_SHA256SUMS
2023-02-06 17:25:29 2023-02-06T16:25:27.461Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-null/3.2.1/terraform-provider-null_3.2.1_SHA256SUMS.72D7468F.sig
2023-02-06 17:25:29 2023-02-06T16:25:28.755Z [DEBUG] Provider signed by 34365D9472D7468F HashiCorp Security (hashicorp.com/security) <security@hashicorp.com>

Nothing more on the error side

#

i switch to trace level

#

i have this log on the engine

2023-02-06 17:19:46 time="2023-02-06T16:19:46Z" level=debug msg="|---> Started Message taoekmp4svhkpm3p7ixy1zb9h:oz5fx1npyqejhvko2o97j18ay" spanID=4d2b3cfa2aa4d154 traceID=1229ea7fbc71ed6d3bad3b7a40f77a43
2023-02-06 17:19:46 time="2023-02-06T16:19:46Z" level=debug msg="|---> File Message taoekmp4svhkpm3p7ixy1zb9h:oz5fx1npyqejhvko2o97j18ay, fd=2, 679 bytes" spanID=4d2b3cfa2aa4d154 traceID=1229ea7fbc71ed6d3bad3b7a40f77a43
2023-02-06 17:19:46 time="2023-02-06T16:19:46Z" level=debug msg="|---> File Message taoekmp4svhkpm3p7ixy1zb9h:oz5fx1npyqejhvko2o97j18ay, fd=1, 1191 bytes" spanID=4d2b3cfa2aa4d154 traceID=1229ea7fbc71ed6d3bad3b7a40f77a43
2023-02-06 17:19:46 time="2023-02-06T16:19:46Z" level=debug msg="|---> Exit Message taoekmp4svhkpm3p7ixy1zb9h:oz5fx1npyqejhvko2o97j18ay, code=0, error=%!s(<nil>)" spanID=4d2b3cfa2aa4d154 traceID=1229ea7fbc71ed6d3bad3b7a40f77a43
2023-02-06 17:19:46 time="2023-02-06T16:19:46Z" level=debug msg="|---> File Message taoekmp4svhkpm3p7ixy1zb9h:oz5fx1npyqejhvko2o97j18ay, fd=2, EOF" spanID=4d2b3cfa2aa4d154 traceID=1229ea7fbc71ed6d3bad3b7a40f77a43
2023-02-06 17:19:46 time="2023-02-06T16:19:46Z" level=debug msg="|---> File Message taoekmp4svhkpm3p7ixy1zb9h:oz5fx1npyqejhvko2o97j18ay, fd=1, EOF" spanID=4d2b3cfa2aa4d154 traceID=1229ea7fbc71ed6d3bad3b7a40f77a43
2023-02-06 17:19:46 time="2023-02-06T16:19:46Z" level=debug msg="|---> Done Message taoekmp4svhkpm3p7ixy1zb9h:oz5fx1npyqejhvko2o97j18ay" spanID=4d2b3cfa2aa4d154 traceID=1229ea7fbc71ed6d3bad3b7a40f77a43
2023-02-06 17:19:46 time="2023-02-06T16:19:46Z" level=debug msg="|<--- ReleaseContainer taoekmp4svhkpm3p7ixy1zb9h" spanID=77bb06ff32e4e726 traceID=e066e8cc0ee7d1ace0e54b46d26f8c2c
humble timber
#

@radiant fog can you try this and check if you eventually get any errors:

#!/bin/bash


id=$(dagger --debug query <<EOF | jq -r .http.id
query {
  container {
    from(address: "hashicorp/terraform:latest") {
      withEntrypoint(args:["sh"]) {
        withExec(args: ["-c", "while true; do wget --spider --server-response https://registry.terraform.io/v1/providers/scaleway/scaleway/versions; sleep 1; done"]) {
          stdout
        }
      }
    }
  }
}
EOF
)

Just trying to rule out of there's a dagger or docker issue

#

I can't seem to repro locally

radiant fog
#

I tried and it seems to work indefinitely

humble timber
#

is the error still randomly happening?

radiant fog
#

when using the terraform cli yes

#

I'll be trying a workaround where i manually download provider and then tells terraform to use them

#

Also sometimes it also go on for ever with this line in loop in the dagger engine : time="2023-02-07T15:30:12Z" level=debug msg="healthcheck completed" actualDuration=5.5133ms spanID=90a652fcdabc9c9a timeout=30s traceID=0563488702692c3f1d174da9baf8ffe9

humble timber
#

are you using docker for mac?

radiant fog
#

docker desktop on windows

humble timber
#

does it happen often? Or sometimes it works?

#

@radiant fog can you check if the same thing happens using a Dockerfile?

#

and then doing docker build

radiant fog
#

oh same error 😄

#
FROM hashicorp/terraform:latest

WORKDIR /tf

RUN wget https://raw.githubusercontent.com/inpulse-tv/EP34-wasi/main/deploy/tf/terraform.tf

RUN terraform init
#

(Off computer but i can still answer)

humble timber
#

😱 k, good to know it's not Dagger related then

#

@radiant fog when would it be a good time to jump into a video call and troubleshoot together?

radiant fog
#

I guess tomorrow end of afternoon for me

radiant fog
#

This is weird it works from my home computer which is windows and docker desktop also 😅

humble timber
#

it's failing from your organization?

#

maybe some sort of corporate proxy?

radiant fog
#

yes that's it
There is probably something with the corporate network or maybe the laptop itself

humble timber
#

I'll mark this as "closed" since there's not too many things left to do here