apache / cloudstack-cloudmonkey

Apache Cloudstack Cloudmonkey
Apache License 2.0
92 stars 61 forks source link

If not sudo strange file lock error / CloudMonkey 6.0.0 (build: 74ff37c, 2019-03-05T17:27:26+0530) #65

Closed synergiator closed 4 years ago

synergiator commented 4 years ago

Just discovered this exception:


Failed to grab config file lock, please try again
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x6973c1]

goroutine 1 [running]:
github.com/apache/cloudstack-cloudmonkey/config.(*Config).UpdateConfig(0xc0000a84e0, 0x76bbda, 0x6, 0x7ffec3d4f642, 0x5, 0x0)
    /home/rohit/lab/apache/cloudmonkey/config/config.go:283 +0x421
main.main()
    /home/rohit/lab/apache/cloudmonkey/cmk.go:63 +0x45e

Which files does cmk need to lock here?

Workaround: sudo

rohityadavcloud commented 4 years ago

@synergiator thanks for reporting the issue. Yes, cmk needs to create its config directory at $HOME/.cmk where it stores config, profiles etc. When running just make sure your user/process has access to allow cloudmonkey to create and manipulate its config/history/profile/cache files. It could be a permission issue (for example run: sudo chown -R : ~/.cmk in case the cmk config path/files are owned by root user)

Can you also share your platform and OS (such as x86_64, Linux) etc. Thanks.

rohityadavcloud commented 4 years ago

Any update @synergiator probably the ~/.cmk is not owned by your user?

synergiator commented 4 years ago

hi there @rhtyd I think yes, this has been a constellation where the path was created by Docker as I used cmk inside a container mounted to local path. Can't reproduce anymore. The intention of this issue was just to maybe have a more explicit error message, telling the user in such occasion which files/folders could not be accessed exactly.

rohityadavcloud commented 4 years ago

Thanks closing as you can't reproduce this anymore. I've added an issue to add check for file permission and proper error msg: https://github.com/apache/cloudstack-cloudmonkey/issues/68