Skip to content
New issue

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

eventlistener/event-listener.go not working as expected #2

Open
surajsprabhu opened this issue Jul 23, 2020 · 3 comments
Open

eventlistener/event-listener.go not working as expected #2

surajsprabhu opened this issue Jul 23, 2020 · 3 comments

Comments

@surajsprabhu
Copy link

surajsprabhu commented Jul 23, 2020

On executing,
go run eventlistener/event-listener.go getting error as below:

panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
main.reader(0x7f53414c4ff8, 0xc000010038)
        /home/saltuser/goworkspace/src/salt-golang/eventlistener/event-listener.go:17 +0x340
main.main()
        /home/saltuser/goworkspace/src/salt-golang/eventlistener/event-listener.go:38 +0x136
exit status 2

Added a condition to prevent this issue from occurring:

dec.Decode(&m1)
if len(m1) == 0 {
        continue
}
m1_1 := m1["body"].(string)

Once this condition is added, the error doesn't occur any more. However, the script simply keeps running and nothing is displayed even when a salt event is fired.

@tsaridas
Copy link
Owner

which version of salt are you running ? asking because I haven't tested on the latest version and they might have changed something.

@surajsprabhu
Copy link
Author

It's salt 2015.5.10

@tsaridas
Copy link
Owner

I need to find some time to test with the version. listener is pretty simple and just unpacks from msgpack so I would suppose there is something wrong with salt version or with your msgpack library.

I'll try to find some time during the w/e to troubleshoot.

Repository owner deleted a comment Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants