cloudstax / firecamp

Serverless Platform for the stateful services
https://www.cloudstax.io
Apache License 2.0
209 stars 20 forks source link

get-service panics #16

Closed jazzl0ver closed 6 years ago

jazzl0ver commented 6 years ago

firecamp-service-cli version is 0.9.2

# ./firecamp-service-cli -cluster=firecamp-qa -region=us-east-1 -service-name=kafka-qa -op=get-service
{ServiceUUID:ae9a07f638c145866458232d81edbead ServiceStatus:ACTIVE LastModified:1513076088004634004 Replicas:3 ClusterName:firecamp-qa ServiceName:kafka-qa Volumes:{PrimaryDeviceName:/dev/xvdm PrimaryVolume:{VolumeType:gp2 VolumeSizeGB:100 Iops:100} JournalDeviceName: JournalVolume:{VolumeType: VolumeSizeGB:0 Iops:0}} RegisterDNS:true DomainName:firecamp-qa-firecamp.com HostedZoneID:/hostedzone/Z1OA04B9KUSH29 RequireStaticIP:false UserAttr:<nil> Resource:{MaxCPUUnits:0 ReserveCPUUnits:0 MaxMemMB:0 ReserveMemMB:0}}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6a8efe]

goroutine 1 [running]:
main.getService(0x7f36078f80e0, 0xc420014410, 0xc4200fbda0)
        /home/junius/work/go/src/github.com/cloudstax/firecamp/syssvc/firecamp-service-cli/main.go:1472 +0x28e
main.main()
        /home/junius/work/go/src/github.com/cloudstax/firecamp/syssvc/firecamp-service-cli/main.go:526 +0xc04
jazzl0ver commented 6 years ago

That might be due server version mismatch. Will update on this thread after upgrading the server

jazzl0ver commented 6 years ago

Stopped the firecamp-manageserver task (ECS has started it again), but that didn't help.

JuniusLuo commented 6 years ago

The get-service works on my testbed. Could you please post the detail error trace?

jazzl0ver commented 6 years ago

How to get that detailed trace?

I don't think it's a server issue, since it responds w/o errors:

18:26:12.493026 IP 172.22.2.56.33810 > 172.22.2.131.27040: Flags [P.], seq 1:233, ack 1, win 141, options [nop,nop,TS val 1274341151 ecr 806874477], length 232
E...$.@.@......8......i.............]......
K...0..mGET /kafka-qa HTTP/1.1
Host: firecamp-manageserver.firecamp-qa-firecamp.com:27040
User-Agent: Go-http-client/1.1
Content-Length: 71
Accept-Encoding: gzip

{"Region":"us-east-1","Cluster":"firecamp-qa","ServiceName":"kafka-qa"}
18:26:12.493371 IP 172.22.2.131.27040 > 172.22.2.56.33810: Flags [.], ack 233, win 235, options [nop,nop,TS val 806874477 ecr 1274341151], length 0
E..45.@............8i......................
0..mK...
18:26:12.501905 IP 172.22.2.131.27040 > 172.22.2.56.33810: Flags [P.], seq 1:787, ack 233, win 235, options [nop,nop,TS val 806874480 ecr 1274341151], length 786
E..F5.@............8i...............s......
0..pK...HTTP/1.1 200 OK
Content-Type: application/json
Server: firecamp
X-Requestid: req-f65dac56774e4a0257fde9aefc091192
Date: Thu, 18 Jan 2018 18:26:12 GMT
Content-Length: 608

{"Service":{"ServiceUUID":"ae9a07f638c145866458232d81edbead","ServiceStatus":"ACTIVE","LastModified":1513076088004634004,"Replicas":3,"ClusterName":"firecamp-qa","ServiceName":"kafka-qa","Volumes":{"PrimaryDeviceName":"/dev/xvdm","PrimaryVolume":{"VolumeType":"gp2","VolumeSizeGB":100,"Iops":100},"JournalDeviceName":"","JournalVolume":{"VolumeType":"","VolumeSizeGB":0,"Iops":0}},"RegisterDNS":true,"DomainName":"firecamp-qa-firecamp.com","HostedZoneID":"/hostedzone/Z1OX04B9KUSH29","RequireStaticIP":false,"UserAttr":null,"Resource":{"MaxCPUUnits":0,"ReserveCPUUnits":256,"MaxMemMB":0,"ReserveMemMB":256}}}
JuniusLuo commented 6 years ago

Thanks! I see. It is a upgrade bug. The old service you created does not have the user attribute. The cli does not check it. Will make a fix.

JuniusLuo commented 6 years ago

The fix is committed. Please get the latest cli and try it. Thanks!

jazzl0ver commented 6 years ago

worked like a charm, thank you!!