Closed tallowen closed 3 weeks ago
@tallowen Do you have a CLOUDFLARE_DEFAULT_ACCOUNT_ID
configured in your env? That does the trick for me
@markhker - thanks, setting that env variable did indeed fix it!
I had a slightly similar issue with Remix + Cloudflare (exposed Go error).
Logs:
sst deploy --verbose
time=2024-05-08T10:41:19.080-03:00 level=INFO msg="checking for pulumi" path="/Users/ruan/Library/Application Support/sst/bin/pulumi"
time=2024-05-08T10:41:19.390-03:00 level=INFO msg="checking for bun" path="/Users/ruan/Library/Application Support/sst/bin/bun"
time=2024-05-08T10:41:19.407-03:00 level=INFO msg="initializing project" version=0.0.355
time=2024-05-08T10:41:19.407-03:00 level=INFO msg="esbuild building"
time=2024-05-08T10:41:19.409-03:00 level=INFO msg="esbuild built" outfile=/Users/ruan/Desktop/sst-rmx/.sst/eval/eval-1715175679407.mjs
time=2024-05-08T10:41:19.409-03:00 level=INFO msg="evaluating config"
time=2024-05-08T10:41:19.518-03:00 level=INFO msg="config evaluated"
time=2024-05-08T10:41:19.519-03:00 level=INFO msg="checking platform"
panic: interface conversion: interface {} is nil, not map[string]interface {}
goroutine 1 [running]:
github.com/sst/ion/pkg/project.(*Project).NeedsInstall(0x140000fc600)
/home/runner/work/ion/ion/pkg/project/install.go:25 +0x29c
main.initProject(0x140006d20f0)
/home/runner/work/ion/ion/cmd/sst/main.go:1591 +0x574
main.init.func3(0x140006d20f0)
/home/runner/work/ion/ion/cmd/sst/main.go:435 +0x38
main.run()
/home/runner/work/ion/ion/cmd/sst/main.go:159 +0x6cc
main.main()
/home/runner/work/ion/ion/cmd/sst/main.go:51 +0x12c
sst.config.ts:
export default $config({
app(input) {
return {
name: "sst-remix",
removal: input?.stage === "production" ? "retain" : "remove",
home: "cloudflare",
};
},
async run() {
new sst.cloudflare.Remix("MyWeb");
},
});
The issue is that I didn't install the Cloudflare provider (obvious I know, but I'm new to SST and the docs don't mention that). Only the AWS provider is installed by default on sst init
.
sst add cloudflare
solved it for me, posting it in case it helps anyone.
is this still an issue in the latest sst? thought i handled the case when there's no account id able to be inferred
@thdxr - should version 0.0.354 have the fix? That version (I believe from yesterday) does have at least the issue when CLOUDFLARE_DEFAULT_ACCOUNT_ID
is not set.
I'm getting a slightly different error, not sure if it is related to this or not. I cloned the ion repo and tried running the cloudflare-remix example, added a .env
file with the CLOUDFLARE_API_TOKEN and CLOUDFLARE_DEFAULT_ACCOUNT_ID values set.
Error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x15ac83b]goroutine 107 [running]:
github.com/sst/ion/pkg/project.(*stack).Run(0xc00098c080, {0x2ae8308, 0xc000b5c5a0}, 0xc00079bcc0)
/home/runner/work/ion/ion/pkg/project/stack.go:535 +0x347b
github.com/sst/ion/pkg/server.startDeployer.func2()
/home/runner/work/ion/ion/pkg/server/deployer.go:33 +0x166
created by github.com/sst/ion/pkg/server.startDeployer in goroutine 1
/home/runner/work/ion/ion/pkg/server/deployer.go:30 +0x1b9
Hopefully that is helpful information.
Edit: on v 0.0.393, I changed CLOUDFLARE_DEFAULT_ACCOUNT_ID
to CLOUDFLARE_ACCOUNT_ID
and no longer was getting a panic.
still happening on 0.390 with no CLOUDFLARE_ACCOUNT_ID set
should be fixed in v0.0.412
It seems like there are a couple of issues that can lead to go panics:
sst add cloudflare
CLOUDFLARE_DEFAULT_ACCOUNT_ID
It would be great if the sst cli would output an error message for these. Especially issue 2 on the above list since it's currently not documented.
--- Original Issue Below ---
I'm trying to deploy the default remix app using a custom domain hosted using cloudflare dns. (Now using v0.0.354 everything deploys properly when I don't cloudflare, thanks for addressing #386 !)
My sst.config.ts
Using sst version 0.0.354:
I'm using: