nhost/hasura-storage

Upgrading to v0.4.0 causes application panic

Closed this issue · 3 comments

jhleao commented

Hi. We were previously running v0.3.6 on self hosted. When attempting to upgrade to v0.4.0 the app panics when handling uploads (POST /v1/files) with the following stack trace:

[Recovery] 2023/11/01 - 02:08:08 panic recovered:

POST /v1/files HTTP/1.1
Host: [REDACTED]
Accept: */*
Client-Ip: [REDACTED]
Content-Length: 311322
Content-Type: multipart/form-data; boundary=X-INSOMNIA-BOUNDARY
Cookie: session=[REDACTED];
Disguised-Host: [REDACTED].azurewebsites.net
Max-Forwards: 10
Traceparent: 00-6dbce7be8b0dda37159d49534c2c4b3d-ba5ca4dac846e382-00
User-Agent: insomnia/2023.2.2
Via: HTTP/2.0 Azure
Was-Default-Hostname: [REDACTED].azurewebsites.net
X-Appservice-Proto: https
X-Arr-Log-Id: 7543c16f-635c-4292-917f-4b0507fe2301
X-Arr-Ssl: 2048|256|CN=Microsoft Azure TLS Issuing CA 02, O=Microsoft Corporation, C=US|CN=*.azurewebsites.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US
X-Azure-Clientip: [REDACTED]
X-Azure-Fdid: [REDACTED]
X-Azure-Ref: [REDACTED]
X-Azure-Requestchainv2: hops=1
X-Azure-Socketip: [REDACTED]
X-Client-Ip: [REDACTED]
X-Client-Port: 48752
X-Forwarded-For: [REDACTED], [REDACTED]
X-Forwarded-Host: [REDACTED]
X-Forwarded-Proto: https
X-Forwarded-Tlsversion: 1.2
X-Original-Url: /v1/files
X-Site-Deployment-Id: [REDACTED]
X-Waws-Unencoded-Url: /v1/files


runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:260 (0x44effc)
runtime/signal_unix.go:841 (0x44efcc)
github.com/nhost/hasura-storage/metadata/hasura.go:19 (0xaeda07)
github.com/nhost/hasura-storage/metadata/hasura.go:143 (0xaeeec7)
github.com/nhost/hasura-storage/controller/upload_file.go:107 (0x96bf2a)
github.com/nhost/hasura-storage/controller/upload_file.go:157 (0x96ca1a)
github.com/nhost/hasura-storage/controller/upload_file.go:293 (0x96dd5a)
github.com/nhost/hasura-storage/controller/upload_file.go:298 (0x96ddef)
github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xaf2a37)
github.com/nhost/hasura-storage/middleware/auth/needs_admin.go:23 (0xaf2a09)
github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xcab5b4)
github.com/nhost/hasura-storage/cmd/serve.go:51 (0xcab591)
github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x93f101)
github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x93f0ec)
github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x93df0a)
github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x93db91)
github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x93d6bc)
net/http/server.go:2936 (0x6f1ff5)
net/http/server.go:1995 (0x6ed511)
runtime/asm_amd64.s:1598 (0x46b0a0)

I have [REDACTED] confidential pieces of information above. This specific request has been triggered from the Insomnia HTTP client for the sake of isolation but the same happens from Chrome.

We're rolling back to v0.3.6 for now. Feel free to ask any questions that would help troubleshoot.

Thanks.

Please, provide steps to reproduce.

Looking at the traceback though it looks like you got a graphql error and for some reason it crashed while trying to parse it so if you could try to see in the hasura logs the error you got that might be useful too.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.