We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beluga has deploy errors when deploying to portainer if the account being used has Administrator access instead of directly assigned permissions.
The error is a panic trying to access a nil map (probably list of endpoints the user has access to)
time="2022-07-16T00:40:37Z" level=info msg="response: [{\"Id\":21,\"Name\":\"swarm-docker1\",\"Type\":2,\"URL\":\"tcp://swarm-docker1[masked url]:9001\",\"GroupId\":7,\"PublicURL\":\"swarm-docker1[masked url]\",\"TLSConfig\":{\"TLS\":true,\"TLSSkipVerify\":true},\"Extensions\":[],\"AzureCredentials\":{\"ApplicationID\":\"\",\"TenantID\":\"\",\"AuthenticationKey\":\"\"},\"TagIds\":[],\"Status\":1,\"Snapshots\":[{\"Time\":1657931868,\"DockerVersion\":\"20.10.17\",\"Swarm\":true,\"TotalCPU\":24,\"TotalMemory\":25022361600,\"RunningContainerCount\":21,\"StoppedContainerCount\":19,\"HealthyContainerCount\":3,\"UnhealthyContainerCount\":0,\"VolumeCount\":35,\"ImageCount\":49,\"ServiceCount\":20,\"StackCount\":5,\"DockerSnapshotRaw\":{\"Containers\":null,\"Volumes\":null,\"Networks\":null,\"Images\":null,\"Info\":null,\"Version\":null}}],\"UserAccessPolicies\":{},\"TeamAccessPolicies\":{},\"EdgeKey\":\"\",\"EdgeCheckinInterval\":0,\"Kubernetes\":{\"Snapshots\":[],\"Configuration\":{\"UseLoadBalancer\":false,\"UseServerMetrics\":false,\"StorageClasses\":[],\"IngressClasses\":[]}},\"ComposeSyntaxMaxVersion\":\"3.9\",\"AuthorizedUsers\":null,\"AuthorizedTeams\":null,\"Tags\":null},{\"Id\":23,\"Name\":\"swarm-docker2\",\"Type\":2,\"URL\":\"tcp://swarm-docker2[masked url]:9001\",\"GroupId\":7,\"PublicURL\":\"swarm-docker2[masked url]\",\"TLSConfig\":{\"TLS\":true,\"TLSSkipVerify\":true},\"Extensions\":[],\"AzureCredentials\":{\"ApplicationID\":\"\",\"TenantID\":\"\",\"AuthenticationKey\":\"\"},\"TagIds\":[],\"Status\":1,\"Snapshots\":[{\"Time\":1657931869,\"DockerVersion\":\"20.10.17\",\"Swarm\":true,\"TotalCPU\":24,\"TotalMemory\":25022361600,\"RunningContainerCount\":21,\"StoppedContainerCount\":19,\"HealthyContainerCount\":3,\"UnhealthyContainerCount\":0,\"VolumeCount\":35,\"ImageCount\":49,\"ServiceCount\":20,\"StackCount\":5,\"DockerSnapshotRaw\":{\"Containers\":null,\"Volumes\":null,\"Networks\":null,\"Images\":null,\"Info\":null,\"Version\":null}}],\"UserAccessPolicies\":{},\"TeamAccessPolicies\":{},\"EdgeKey\":\"\",\"EdgeCheckinInterval\":0,\"Kubernetes\":{\"Snapshots\":[],\"Configuration\":{\"UseLoadBalancer\":false,\"UseServerMetrics\":false,\"StorageClasses\":[],\"IngressClasses\":[]}},\"ComposeSyntaxMaxVersion\":\"3.9\",\"AuthorizedUsers\":null,\"AuthorizedTeams\":null,\"Tags\":null},{\"Id\":24,\"Name\":\"swarm-docker3\",\"Type\":2,\"URL\":\"tcp://swarm-docker3[masked url]:9001\",\"GroupId\":7,\"PublicURL\":\"swarm-docker3[masked url]\",\"TLSConfig\":{\"TLS\":true,\"TLSSkipVerify\":true},\"Extensions\":[],\"AzureCredentials\":{\"ApplicationID\":\"\",\"TenantID\":\"\",\"AuthenticationKey\":\"\"},\"TagIds\":[],\"Status\":1,\"Snapshots\":[{\"Time\":1657931869,\"DockerVersion\":\"20.10.17\",\"Swarm\":true,\"TotalCPU\":24,\"TotalMemory\":25022361600,\"RunningContainerCount\":21,\"StoppedContainerCount\":19,\"HealthyContainerCount\":3,\"UnhealthyContainerCount\":0,\"VolumeCount\":35,\"ImageCount\":49,\"ServiceCount\":20,\"StackCount\":5,\"DockerSnapshotRaw\":{\"Containers\":null,\"Volumes\":null,\"Networks\":null,\"Images\":null,\"Info\":null,\"Version\":null}}],\"UserAccessPolicies\":{},\"TeamAccessPolicies\":{},\"EdgeKey\":\"\",\"EdgeCheckinInterval\":0,\"Kubernetes\":{\"Snapshots\":[],\"Configuration\":{\"UseLoadBalancer\":false,\"UseServerMetrics\":false,\"StorageClasses\":[],\"IngressClasses\":[]}},\"ComposeSyntaxMaxVersion\":\"3.9\",\"AuthorizedUsers\":null,\"AuthorizedTeams\":null,\"Tags\":null}]\n" time="2022-07-16T00:40:37Z" level=info msg="GET [masked portainer endpoint]" panic: assignment to entry in nil map goroutine 1 [running]: github.com/duckbrain/beluga/internal/portainer.Env.UnmarshalJSON(0x0, 0xc00025233e, 0x9d, 0x7ac2, 0xc0005c6310, 0xc000252000) /code/internal/portainer/portainer_client.go:131 +0xfe encoding/json.(*decodeState).array(0xc0005c62e8, 0x8f1300, 0xc0000d0250, 0x195, 0xc0005c6310, 0x5b) /usr/local/go/src/encoding/json/decode.go:503 +0xc10 encoding/json.(*decodeState).value(0xc0005c62e8, 0x8f1300, 0xc0000d0250, 0x195, 0x8f1300, 0xc0000d0250) /usr/local/go/src/encoding/json/decode.go:360 +0xfd encoding/json.(*decodeState).object(0xc0005c62e8, 0x9112a0, 0xc0000d0230, 0x199, 0xc0005c6310, 0x7b) /usr/local/go/src/encoding/json/decode.go:765 +0x12e0 encoding/json.(*decodeState).value(0xc0005c62e8, 0x9112a0, 0xc0000d0230, 0x199, 0x9112a0, 0xc0000d0230) /usr/local/go/src/encoding/json/decode.go:370 +0x6d encoding/json.(*decodeState).array(0xc0005c62e8, 0x89fa20, 0xc000564180, 0x16, 0xc0005c6310, 0x5b) /usr/local/go/src/encoding/json/decode.go:558 +0x1a7 encoding/json.(*decodeState).value(0xc0005c62e8, 0x89fa20, 0xc000564180, 0x16, 0xc000687240, 0x76e23e) /usr/local/go/src/encoding/json/decode.go:360 +0xfd encoding/json.(*decodeState).unmarshal(0xc0005c62e8, 0x89fa20, 0xc000564180, 0x0, 0x1) /usr/local/go/src/encoding/json/decode.go:180 +0x1f0 encoding/json.(*Decoder).Decode(0xc0005c62c0, 0x89fa20, 0xc000564180, 0x7f8b21da4280, 0xc0000c26e0) /usr/local/go/src/encoding/json/stream.go:73 +0x166 github.com/duckbrain/beluga/internal/portainer.(*Client).do(0xc00011c240, 0x9489e9, 0x3, 0xc000028690, 0x2f, 0x8e0660, 0xc000582200, 0x0, 0x0, 0x89fa20, ...) /code/internal/portainer/portainer_client.go:186 +0x505 github.com/duckbrain/beluga/internal/portainer.(*Client).Stacks(0xc00011c240, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /code/internal/portainer/portainer_client.go:255 +0x174 github.com/duckbrain/beluga.(*portainerDeploy).findStack(0xc000110780, 0x18, 0xc0000252a0, 0xd, 0x0, 0x0, 0x0) /code/deployer.go:274 +0x58 github.com/duckbrain/beluga.(*portainerDeploy).Deploy.func1(0x18, 0xc000580142, 0xd, 0xc0005ca0a0, 0x18) /code/deployer.go:295 +0x8e github.com/duckbrain/beluga.(*portainerDeploy).tryEndpoints(0xc000110780, 0xc000687ca8, 0x24, 0xc0002ee680) /code/deployer.go:264 +0x22d github.com/duckbrain/beluga.(*portainerDeploy).Deploy(0xc000110780, 0x9f9a00, 0xc000024620, 0x9f4500, 0xc000114140, 0xc000110780, 0x4) /code/deployer.go:294 +0x1fc github.com/duckbrain/beluga.(*Runner).Deploy(0xc000114140, 0x9f9a00, 0xc000024620, 0x0, 0x0) /code/runner.go:66 +0x8a github.com/duckbrain/beluga/cmd.glob..func2(0xcca300, 0xd3bc40, 0x0, 0x0, 0x0, 0x0) /code/cmd/deploy.go:14 +0x45 github.com/spf13/cobra.(*Command).execute(0xcca300, 0xd3bc40, 0x0, 0x0, 0xcca300, 0xd3bc40) /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:852 +0x453 github.com/spf13/cobra.(*Command).ExecuteC(0xccad00, 0x4440fa, 0xcd3a80, 0xc000000180) /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x349 github.com/spf13/cobra.(*Command).Execute(...) /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897 github.com/duckbrain/beluga/cmd.Execute() /code/cmd/root.go:42 +0x31 main.main() /code/cmd/beluga/main.go:6 +0x20
The text was updated successfully, but these errors were encountered:
Workaround for the issue is to directly assign access to endpoints to your deploy user account
Sorry, something went wrong.
#11 Fix nil map panic when unmarshalling environment variables from p…
54517da
…ortainer
Merge pull request #12 from duckbrain/11-panic-on-non-nil-env-from-po…
93ac273
…rtainer #11 Fix nil map panic when unmarshalling environment variables from p…
No branches or pull requests
Beluga has deploy errors when deploying to portainer if the account being used has Administrator access instead of directly assigned permissions.
The error is a panic trying to access a nil map (probably list of endpoints the user has access to)
The text was updated successfully, but these errors were encountered: