xverges/wa-cli

Getting key error when trying to enable sandbox

EdwardYGLi opened this issue · 4 comments

Followed the instructions on the readme and setup with the ibm cloud apikey and url. When trying to enable sandbox, I get :

image

Please advise.

Hello @EdwardYGLi

Unfortunately I won't be able to help you: I am not anymore a user of Watson Assistant and I don't plan to maintain this project. I suggest that you migrate to the fork maintained by @vanildo.

The error is happening when the code tries to display the headers related to [Rate Limiting(https://cloud.ibm.com/apidocs/assistant/assistant-v2#rate-limiting). Checking at the code I see now that the headers are fetched, unconditionally, without checking the response status https://github.com/vanildo/wa-cli/blob/master/wa_cli/commands/wa/wa.py#L26 and that does not look like a very robust approach. My bad :-(

My first hypothesis would be that there is some issue with the apikey. Can you verify that echo $WA_APIKEY and echo $WA_URL display the proper values? And if they don't, can you verify that the the .env file has the proper values? If that is the case, it would be an indication that you skipped the command that wa-cli init asked you to run (or that there was some issue running it).

Hope this helps.

Hey @xverges ,

Thanks for your reply, I will take a look at that fork. In terms of debugging, I followed the readme and ran wa-cli init and passed in the apikey and url from the ibm cloud page for the WA assistant:

image

I've also checked that the .env had the correct values and checked that the environment variables are correct. I will test out some more, additionally, if you know any tools that perform similar functions such as the wa-cli (git tracking, sandboxes, programmer friendly WA deployment etc), please let me know.

Cheers,
Edward

If you feel comfortable with Python, you may want to add some print() statements in _trace_rate_limits() in wa.py to see what is that is coming back from the Watson calls.

Not that I would bet on this, but I see that you are using Python 3.9. I only tested the project in 3.8. Maybe worth a try?

if you know any tools that perform similar functions such as the wa-cli (git tracking, sandboxes, programmer friendly WA deployment etc)

No :-) That's why I created the project

Ok, I will debug it and test with python 3.8., though I doubt python version affects this problem. I was also looking for those tools and found your tool, which looked the most promising :). Alright, let me close this issue for now. I'll update you if I end up fixing the problem.