cf-terraforming
cf-terraforming copied to clipboard
panic: runtime error: invalid memory address or nil pointer dereference
Confirmation
- [X] My issue isn't already found on the issue tracker.
- [X] I have replicated my issue using the latest version of the library and it is still present.
cf-terraforming version
v0.18.0 and up
Expected outcome
I was expecting to receive:
terraform init && cf-terraforming generate --zone "ZONE" --resource-type "cloudflare_record" --email $TF_VAR_cf_mail --token $TF_VAR_cf_api_token -vvv || true
Initializing the backend...
Initializing provider plugins...
- Reusing previous version of cloudflare/cloudflare from the dependency lock file
- Using previously-installed cloudflare/cloudflare v4.30.0
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work.
If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.
DEBU[0000] initializing cloudflare-go with API Token account_Id= zone_id=****** DEBU[0004] initializing Terraform in .
DEBU[0004] reading Terraform schema for Cloudflare provider DEBU[0004] beginning to read and build cloudflare_record resources 2024/04/26 17:30:50 GET /client/v4/zones/******/dns_records?page=1&per_page=100 HTTP/1.1 Host: api.cloudflare.com User-Agent: cloudflare-go/v4 Authorization: Bearer [redacted] Content-Type: application/json Accept-Encoding: gzip2024/04/26 17:30:51 HTTP/2.0 200 OK Cf-Cache-Status: DYNAMIC Cf-Ray: 87a84d9678c337ca-FRA Content-Type: application/json Date: Fri, 26 Apr 2024 17:30:52 GMT Server: cloudflare Set-Cookie: __cflb=0H28vgHxwvgAQt********TKFwHfQtFKK; SameSite=Lax; path=/; expires=Fri, 26-Apr-24 20:00:53 GMT; HttpOnly Set-Cookie: __cfruid=3c7f53b59122*******2ca64fb3343b4a-1714152652; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None Vary: Accept-Encoding
{"result":[{"id":"d8e0f3cc452c8fc6636ab60","zone_id":"","zone_name":"domain*****.link","name":"www.domain******.link","type":"AAAA","content":"100::","proxiable":true,"proxied":true,"ttl":1,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false},"comment":null,"tags":[],"created_on":"2024-04-26T12:20:40.237697Z","modified_on":"2024-04-26T12:20:40.237697Z"},{"id":"236747321ebf18081a84709086c616d1","zone_id":"","zone_name":"domain.link","name":"_acme-challenge.domain******.link","type":"CNAME","content":"domain******.link.4f882c14279cc60d.dcv.cloudflare.com","proxiable":true,"proxied":false,"ttl":60,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false},"comment":null,"tags":[],"created_on":"2024-04-26T12:20:38.052793Z","modified_on":"2024-04-26T12:20:38.052793Z"},{"id":"60e91648764cf04e3f12497e","zone_id":"","zone_name":"domain******.link","name":"domain******.link","type":"CNAME","content":"domain..m.xyz","proxiable":true,"proxied":false,"ttl":60,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false},"comment":null,"tags":[],"created_on":"2024-04-26T12:20:39.015434Z","modified_on":"2024-04-26T12:20:39.015434Z"},{"id":"a65e8f6d5a61d3f4a6b3f05","zone_id":"","zone_name":"domain*****.link","name":"m.domain******.link","type":"CNAME","content":"domain******.link","proxiable":true,"proxied":true,"ttl":1,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false},"comment":null,"tags":[],"created_on":"2024-04-26T12:20:38.777283Z","modified_on":"2024-04-26T12:20:38.777283Z"}],"success":true,"errors":[],"messages":[],"result_info":{"page":1,"per_page":100,"count":4,"total_count":4,"total_pages":1}} DEBU[0005] got unknown attribute configuration: key allow_overwrite, value
, value type DEBU[0005] got unknown attribute configuration: key comment, value , value type DEBU[0005] got unknown attribute configuration: key priority, value , value type DEBU[0005] got unknown attribute configuration: key tags, value , value type DEBU[0005] got unknown attribute configuration: key allow_overwrite, value , value type DEBU[0005] got unknown attribute configuration: key comment, value , value type DEBU[0005] got unknown attribute configuration: key priority, value , value type DEBU[0005] got unknown attribute configuration: key tags, value , value type DEBU[0005] got unknown attribute configuration: key allow_overwrite, value , value type DEBU[0005] got unknown attribute configuration: key comment, value , value type DEBU[0005] got unknown attribute configuration: key priority, value , value type DEBU[0005] got unknown attribute configuration: key tags, value , value type DEBU[0005] got unknown attribute configuration: key allow_overwrite, value , value type DEBU[0005] got unknown attribute configuration: key comment, value , value type DEBU[0005] got unknown attribute configuration: key priority, value , value type DEBU[0005] got unknown attribute configuration: key tags, value , value type resource "cloudflare_record" "terraform_managed_resource_d8e0f3cc452cab98fc6636ab60" { name = "www" proxied = true ttl = 1 type = "AAAA" value = "100::" zone_id = "*" } resource "cloudflare_record" "terraform_managed_resource_236747321ebf09086c616d1" { name = "_acme-challenge" proxied = false ttl = 60 type = "CNAME" value = "domain.link.4f8******.cloudflare.com" zone_id = "******" }
Actual outcome
terraform init && cf-terraforming generate --zone "ZONE" --resource-type "cloudflare_record" --email $TF_VAR_cf_mail --token $TF_VAR_cf_api_token -vvv || true
Initializing the backend... Initializing provider plugins...
- Finding cloudflare/cloudflare versions matching "~> 4.0"...
- Installing cloudflare/cloudflare v4.30.0...
- Installed cloudflare/cloudflare v4.30.0 (self-signed, key ID C76001609EE3B136) Partner and community providers are signed by their developers. If you'd like to know more about provider signing, you can read about it here: https://www.terraform.io/docs/cli/plugins/signing.html Terraform has created a lock file .terraform.lock.hcl to record the provider selections it made above. Include this file in your version control repository so that Terraform can guarantee to make the same selections by default when you run "terraform init" in the future. Terraform has been successfully initialized! You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work. If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.
time="2024-04-26T17:16:40Z" level=debug msg="initializing cloudflare-go with API Token" account_Id= zone_id=ZONE time="2024-04-26T17:16:41Z" level=debug msg="initializing Terraform in ." time="2024-04-26T17:16:41Z" level=debug msg="reading Terraform schema for Cloudflare provider" time="2024-04-26T17:16:42Z" level=debug msg="beginning to read and build cloudflare_record resources" panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x79981e] goroutine 1 [running]: github.com/cloudflare/cloudflare-go.(*API).makeRequestContext(0xc000366040?, {0xc80a50?, 0xc000126000?}, {0xb6d795?, 0x1?}, {0xc00036ae00?, 0x470ee5?}, {0x0?, 0x0?}) /home/runner/go/pkg/mod/github.com/cloudflare/[email protected]/cloudflare.go:172 +0x3e github.com/cloudflare/cloudflare-go.(*API).ListDNSRecords(, {, _}, _, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}) /home/runner/go/pkg/mod/github.com/cloudflare/[email protected]/dns.go:252 +0x21a github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.generateResources.func1(0x1088660?, {0xb6dc07?, 0x9?, 0x9?}) /home/runner/work/cf-terraforming/cf-terraforming/internal/app/cf-terraforming/cmd/generate.go:703 +0x10cf github.com/spf13/cobra.(*Command).execute(0x1088660, {0xc000272360, 0x9, 0x9}) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0xa91 github.com/spf13/cobra.(*Command).ExecuteC(0x1088380) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x425 github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039 github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.Execute() /home/runner/work/cf-terraforming/cf-terraforming/internal/app/cf-terraforming/cmd/root.go:30 +0x25 main.main() /home/runner/work/cf-terraforming/cf-terraforming/cmd/cf-terraforming/main.go:8 +0x17
Steps to reproduce
Dockerfile latest version
#ARG GOARCH=arm64 ARG GOARCH=amd64
FROM golang:1.21.3-bullseye as build RUN git clone https://github.com/cloudflare/cf-terraforming.git /go/cf-terraforming &&
cd /go/cf-terraforming &&
CGO_ENABLED=0 GOARCH=${GOARCH} go build -o cf-terraforming cmd/cf-terraforming/main.goFROM python:3.6 COPY --from=build /go/cf-terraforming/cf-terraforming /usr/local/bin/cf-terraforming
RUN apt update &&
apt install -y lsb-release wget &&
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg &&
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list &&
apt update && apt install -y terraform &&
apt clean && rm -rf /var/lib/apt/lists/*RUN pip install --no-cache-dir requests pyyaml WORKDIR /app
And I also tested versions lower than the latest one.
FROM debian:bullseye-slim as build RUN apt-get update && apt-get install -y wget tar &&
wget https://github.com/cloudflare/cf-terraforming/releases/download/v0.18.0/cf-terraforming_0.18.0_linux_amd64.tar.gz &&
tar -xzf cf-terraforming_0.18.0_linux_amd64.tar.gz -C /usr/local/binFROM python:3.6 COPY --from=build /usr/local/bin/cf-terraforming /usr/local/bin/cf-terraforming
RUN apt update &&
apt install -y lsb-release wget &&
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg &&
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list &&
apt update && apt install -y terraform &&
apt clean && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir requests pyyaml
As a result, containers built on a Mac (M1) work as expected, but those built on the amd64 architecture using Kaniko return an error.
References
No response
I've tried various versions of both Golang and build systems, as well as different versions of the application itself, but the error remains the same.
I have the same (or similar) problem, running it in Github actions with
go version go1.22.3 linux/amd64
time="2024-05-10T07:02:08Z" level=error msg="failed to exec to `git`"
cf-terraforming -dev+a102dba56329
golang installed based on https://github.com/actions/setup-go no amount of pinning versions around (golang version, cf-terraforming version) makes any difference errors I get are
c582740762f62fb2625812a2a8c54687 - cloudflare_access_application...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x79bf78]
goroutine 1 [running]:
github.com/cloudflare/cloudflare-go.(*API).makeRequestContext(0xc000[33](https://github.com/worksome/terraform/actions/runs/9028553445/job/24809247021#step:7:34)5580?, {0xc88210?, 0x11373c0?}, {0xb6a9fc?, 0x2?}, {0xc00013d280?, 0x0?}, {0x0?, 0x0?})
/home/runner/go/pkg/mod/github.com/cloudflare/[email protected]/cloudflare.go:172 +0x38
github.com/cloudflare/cloudflare-go.(*API).ListAccessApplications(0x0, {0xc88210, 0x11373c0}, 0xc0005467b0, {{0x1, 0x19, 0x0, 0x0, 0x0, {0x0, ...}, ...}})
/home/runner/go/pkg/mod/github.com/cloudflare/[email protected]/access_application.go:247 +0x1cf
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.init.generateResources.func3(0x10ce[38](https://github.com/worksome/terraform/actions/runs/9028553445/job/24809247021#step:7:39)0, {0xb6aca9?, 0x4?, 0xb6ac2d?})
/home/runner/go/pkg/mod/github.com/cloudflare/[email protected]/internal/app/cf-terraforming/cmd/generate.go:114 +0x3daf
github.com/spf13/cobra.(*Command).execute(0x10ce380, {0xc0001084e0, 0x6, 0x6})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0xab1
c582740762f62fb2625812a2a8c54687 - cloudflare_access_ca_certificate...
github.com/spf13/cobra.(*Command).ExecuteC(0x10ce0a0)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:10[39](https://github.com/worksome/terraform/actions/runs/9028553445/job/24809247021#step:7:40)
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.Execute()
/home/runner/go/pkg/mod/github.com/cloudflare/[email protected]/internal/app/cf-terraforming/cmd/root.go:30 +0x1a
main.main()
/home/runner/go/pkg/mod/github.com/cloudflare/[email protected]/cmd/cf-terraforming/main.go:8 +0xf
command I run is along the lines of
cf-terraforming generate -t $CLOUDFLARE_READONLY_API_TOKEN --resource-type "$resourcetype" --zone $zone > $outfolder/$zone.$resourcetype.tf
With the help of the Golang community granting me a second eye, we were able to find the likely culprit in the CI=true env var that Github Actions sets by default, so the immediate workaround for me is to just unset it (at least during the run of this cf-terraforming command).
I would recommend though that maybe the maintainers of the repo could consider a different strategy for what they are trying to achieve, one that could range from using a different env var to at least documenting it better (currently missing from docs, as far as I could tell).
This issue hasn't been updated in a while. If it's still reproducing, please comment to let us know. Thank you!
Also happened for me on both Windows and WSL cf-terraforming v0.23.3 Terraform v1.11.4
started working after removing the terrform directory and re doing terraform init
This is happening for me
❯ terraform -v
Terraform v1.11.4
on darwin_arm64
❯ cf-terraforming version
cf-terraforming 0.23.3
❯ cf-terraforming generate --resource-type cloudflare_ruleset --zone <myzone>
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x1029e3d54]
goroutine 1 [running]:
github.com/hashicorp/go-version.(*Version).String(0x0)
/Users/me/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/hashicorp/[email protected]/version.go:386 +0x34
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.init.generateResources.func2(0x10362cb60, {0x102c12d16?, 0x4?, 0x102c12c4a?})
internal/app/cf-terraforming/cmd/generate.go:91 +0x470
github.com/spf13/cobra.(*Command).execute(0x10362cb60, {0x14000117c00, 0x4, 0x4})
/Users/me/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:989 +0x81c
github.com/spf13/cobra.(*Command).ExecuteC(0x10362d120)
/Users/me/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
/Users/me/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.Execute()
internal/app/cf-terraforming/cmd/root.go:30 +0x24
main.main()
cmd/cf-terraforming/main.go:8 +0x1c
any workaround
I just realized that there was an issue with my terraform configuration. Once i corrected my terraform config to be valid, i re-ran my cf-terraforming and it worked as expected.
This seems to be fully reproducable by creating an empty directory and attempting to run a cf-terraforming command from it. When i do that I get the sigsegv error.
I think rather than a segfault it would be preferable for the tool to identify a missing/invalid configuration and to provide a useful, actionable, error message.
Did anyone figure this out?
I've had an open support ticket with CloudFlare Support for 4 months regarding this issue. Their resolution was to link me to this issue. Don't hold your breath that it will ever be fixed as CloudFlare is known for this poor level of support. I'll share their response in 2-3 months when they update my support ticket again.
Cloudflare Support is completely dead. I think they fired all support personnel and offshored it to one lone Indian subcontractor. Cloudflare execs should be ashamed of their poor decision-making
@skooter777 Thank you for the feedback! Can you try on the latest master and see if this still an issue?
The working directory must be a directory where terraform is initialized. This should fail gracefully now.
@cameron-wellthy I'm so sorry to hear that. Can you reach out to your account rep and escalate the issue to engineering?
@vaishakdinesh I escalated it through my customer rep 3 times. They closed my ticket out and referred me to this issue. Safe to say unless you pay the outrageous fee for CloudFlare enterprise, you will not get support.
@cameron-wellthy im sorry to hear that. Is your issue in cf-terraforming or the provider? Do you have a github issue?
@cameron-wellthy
In case it makes you feel any better, I can I promise you that even if you're an enterprise customer you don't get any better support from their customer support ticketing system 😂
Hey everyone, let's please keep comments on topic and civil per the published code of conduct. We won't tolerate abusive comments towards members of the community or employees. Thanks!
I'm having the same issue on mac os Sequoia 15.5
> terraform -v
Terraform v1.12.2
on darwin_arm64
> cf-terraforming version
cf-terraforming 0.23.3
> ls -la
total 3
drwxr-xr-x 4 albor staff 128 Jul 2 14:41 .
drwxr-xr-x 3 albor staff 96 Jul 2 14:01 ..
drwxr-xr-x 3 albor staff 96 Jul 2 14:41 .terraform
> cf-terraforming generate --resource-type cloudflare_ruleset --zone $CLOUDFLARE_ZONE_ID
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x100f5dd04]
goroutine 1 [running]:
github.com/hashicorp/go-version.(*Version).String(0x0)
/Users/albor/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/hashicorp/[email protected]/version.go:386 +0x34
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.init.generateResources.func2(0x101c4e3c0, {0x1011cf253?, 0x4?, 0x1011cf187?})
internal/app/cf-terraforming/cmd/generate.go:91 +0x470
github.com/spf13/cobra.(*Command).execute(0x101c4e3c0, {0x140001afd80, 0x4, 0x4})
/Users/albor/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:989 +0x83c
github.com/spf13/cobra.(*Command).ExecuteC(0x101c4e980)
/Users/albor/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x378
github.com/spf13/cobra.(*Command).Execute(...)
/Users/albor/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.Execute()
internal/app/cf-terraforming/cmd/root.go:30 +0x24
main.main()
cmd/cf-terraforming/main.go:8 +0x1c
@alborworld can you try building the latest master and see if its an issue? i think you're still using the last release https://github.com/cloudflare/cf-terraforming?tab=readme-ov-file#build-cf-terraforming-locally
Ran into all sorts of issues that resulted in similar errors. I assumed that I would be able to run this in my existing terraform project, but it seems cf-terraforming doesn't like that. My solution:
- Create a new, empty folder
- Add a
provider.tffile with the following contents
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 5.5"
}
}
}
- Run
terraform init - Run whatever
cf-terraformingcommands you need
I had a similar error with creating a tunnel via docker. Interestingly, the error was simply:
failed to create tunnel: Unknown output format 'default'
but changing the output format to JSON I got the error trace as:
panic: runtime error: invalid memory address or nil pointer dereference
cfHttp-1 | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa8c788]
cfHttp-1 |
cfHttp-1 | goroutine 1 [running]:
cfHttp-1 | github.com/cloudflare/cloudflared/cmd/cloudflared/tunnel.runAdhocNamedTunnel(0x40007176d0, {0xffffd0efdf00, 0x16}, {0x0, 0x0})
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/cmd/cloudflared/tunnel/cmd.go:308 +0x148
cfHttp-1 | github.com/cloudflare/cloudflared/cmd/cloudflared/tunnel.TunnelCommand(0x4000464ac0)
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/cmd/cloudflared/tunnel/cmd.go:256 +0x15c
cfHttp-1 | github.com/cloudflare/cloudflared/cmd/cloudflared/tunnel.buildTunnelCommand.ConfiguredAction.func1(0x4000464ac0?, {0x4000199c60?, 0x4000327c00?})
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/cmd/cloudflared/cliutil/handler.go:18 +0x24
cfHttp-1 | github.com/cloudflare/cloudflared/cmd/cloudflared/tunnel.buildTunnelCommand.ConfiguredAction.ConfiguredActionWithWarnings.func2(0x4000464ac0)
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/cmd/cloudflared/cliutil/handler.go:31 +0x58
cfHttp-1 | github.com/cloudflare/cloudflared/cmd/cloudflared/tunnel.buildTunnelCommand.ConfiguredAction.ConfiguredActionWithWarnings.WithErrorHandler.func3(0x4000464ac0)
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/cmd/cloudflared/cliutil/errors.go:27 +0x2c
cfHttp-1 | github.com/urfave/cli/v2.(*App).RunAsSubcommand(0x400033e9c0, 0x4000452fc0)
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/vendor/github.com/urfave/cli/v2/app.go:439 +0x73c
cfHttp-1 | github.com/urfave/cli/v2.(*Command).startApp(0x40004267e0, 0x4000452fc0)
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/vendor/github.com/urfave/cli/v2/command.go:279 +0x670
cfHttp-1 | github.com/urfave/cli/v2.(*Command).Run(0x4000305808?, 0x4000335500?)
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/vendor/github.com/urfave/cli/v2/command.go:94 +0x70
cfHttp-1 | github.com/urfave/cli/v2.(*App).RunContext(0x400033e680, {0xfe4880, 0x1e6dc60}, {0x400003a270, 0xd, 0xd})
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/vendor/github.com/urfave/cli/v2/app.go:313 +0x724
cfHttp-1 | github.com/urfave/cli/v2.(*App).Run(...)
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/vendor/github.com/urfave/cli/v2/app.go:224
cfHttp-1 | main.runApp(0x400033e680, 0xe?)
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/cmd/cloudflared/linux_service.go:39 +0x3e0
cfHttp-1 | main.main()
cfHttp-1 | /go/src/github.com/cloudflare/cloudflared/cmd/cloudflared/main.go:94 +0x8cc
It seems the issue started to happen with tag cloudflare/cloudflared:2025.6.1 and switching to cloudflare/cloudflared:2025.6.0 resolved it.
It seems the option --output was introduced with the new version, so the error could somehow be related to output format.
Same problem here
time="2025-07-11T13:07:27Z" level=info msg="Using Terraform binary from explicit path" terraform-binary-path=/usr/local/bin/terraform
time="2025-07-11T13:07:27Z" level=info msg="detected provider" registry=registry.terraform.io/cloudflare/cloudflare version=5.5.0
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x8133da]
goroutine 1 [running]:
github.com/cloudflare/cloudflare-go/v4.(*Client).Execute(...)
/home/runner/go/pkg/mod/github.com/cloudflare/cloudflare-go/[email protected]/client.go:383
github.com/cloudflare/cloudflare-go/v4.(*Client).Get(0xc0000e3840?, {0xf57000, 0x154ee80}, {0xc000e1bdc0, 0x33}, {0x0, 0x0}, {0xb351c0, 0xc000c9e9c0}, {0x0, ...})
/home/runner/go/pkg/mod/github.com/cloudflare/cloudflare-go/[email protected]/client.go:390 +0x5a
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.getAPIResponse(0x0, {0x0, 0x0, 0x15?}, {0xc0000e57a0, 0x1, 0x0?})
/home/runner/work/cf-terraforming/cf-terraforming/internal/app/cf-terraforming/cmd/custom_processing.go:446 +0x38d
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.init.generateResources.func2(0x1524740, {0xe24f27?, 0x4?, 0xe24e5f?})
/home/runner/work/cf-terraforming/cf-terraforming/internal/app/cf-terraforming/cmd/generate.go:182 +0x1337
github.com/spf13/cobra.(*Command).execute(0x1524740, {0xc00007a420, 0x6, 0x6})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1019 +0xa7b
github.com/spf13/cobra.(*Command).ExecuteC(0x1524480)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x40c
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.Execute()
/home/runner/work/cf-terraforming/cf-terraforming/internal/app/cf-terraforming/cmd/root.go:67 +0x1a
main.main()
/home/runner/work/cf-terraforming/cf-terraforming/cmd/cf-terraforming/main.go:8 +0xf
@harutyundr just wanna confirm the issue is with cf-terraforming?
Seems like you're running into an issue with cloudflared https://github.com/cloudflare/cloudflared ? You might wanna raise the issue there if it is cloudflared.
@alborworld can you try building the latest master and see if its an issue? i think you're still using the last release https://github.com/cloudflare/cf-terraforming?tab=readme-ov-file#build-cf-terraforming-locally
@vaishakdinesh building it worked! Thank you.
Why doesn't the homebrew version work? Was it after the last release?
@alborworld can you try building the latest master and see if its an issue? i think you're still using the last release https://github.com/cloudflare/cf-terraforming?tab=readme-ov-file#build-cf-terraforming-locally
@vaishakdinesh building it worked! Thank you.
Why doesn't the homebrew version work? Was it after the last release?
@alborworld glad to hear it worked! Can you try getting the latest? We made v0.24.0 release end of last week. It should be fixed there too.
@harutyundr just wanna confirm the issue is with cf-terraforming? Seems like you're running into an issue with
cloudflaredhttps://github.com/cloudflare/cloudflared ? You might wanna raise the issue there if it is cloudflared.
It is ineeded with cloudflared, just the error message looks very similar, and I thought it might be due to some shared component.
@harutyundr just wanna confirm the issue is with cf-terraforming? Seems like you're running into an issue with
cloudflaredhttps://github.com/cloudflare/cloudflared ? You might wanna raise the issue there if it is cloudflared.It is ineeded with cloudflared, just the error message looks very similar, and I thought it might be due to some shared component.
Ahh no worries! This is a different tool, but probably use similar packages like viper, cobra and the cloudflare-go sdk.
My issue was that I was trying to run the cf-terraforming command before having run terraform init. I had my main.tf file set like this:
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 5"
}
}
}
Then run terraform init
Then run you cf-terraforming command.
Works for me.