i made some changes today to my System to remove an SSL error connecting Visual Studio to GitHub (unrelated to Smartthings but relevant). now, the CLI is having issues with the proxy server any idea?
i cleared all the cache as i had seen @nayelyz mention in another thread and i added the debug environment variable for the logging
C:\Program Files (x86)\SmartThings>smartthings.exe locations
[2023-03-07T16:56:18.788] [DEBUG] login-authenticator - authentication - enter
[2023-03-07T16:56:18.797] [DEBUG] login-authenticator - login start: listening on port 61973
[2023-03-07T16:56:19.687] [DEBUG] login-authenticator - redirecting to https://oauthin-regional.api.smartthings.com/oauth/authorize
[2023-03-07T16:56:23.693] [DEBUG] login-authenticator - making axios request: https://oauthin-regional.api.smartthings.com/oauth/token
[2023-03-07T16:56:23.738] [ERROR] login-authenticator - error obtaining token: getaddrinfo ENOTFOUND proxy.*[my company's domain]*.com
[2023-03-07T16:57:26.471] [ERROR] login-authenticator - unable to get authentication info
This was working last week. I took some steps to add some certificates into a directory as needed to make Visual studio play nice with GitHub… sine then it is not working. I don’t know enough on the networking side of things to understand if the two are related or how to overcome the issue… I am really good a system design and factory automation, but networking… ehhh… black box, I just trust my IT and infra teams
Hi, @AZSteve
Can you try using cURL to send a command directly to the API to see if that works, please?
You can use the sample below, remember to replace YOUR_PAT_HERE with the actual value:
now we are getting somewhere… the curl option works. i then tried the CLI, it also works…-ish
in both cases, the call for locations works, they both (cURL and CLI) return my locations (only 1)… but when i extend that to rules… they both return empty
the call(s) do however work for scenes. i get the list of all my scenes using both the cURL and CLI methods
C:\Program Files (x86)\SmartThings>smartthings.exe rules
[2023-03-09T09:51:12.322] [DEBUG] rest-client - making axios request: {"url":"https://api.smartthings.com/locations","method":"get","headers":{"Content-Type":"application/json;charset=utf-8","Accept":"application/json","User-Agent":"@smartthings/cli/1.1.2 win32-x64 node-v16.16.0","Accept-Language":"en-US","Authorization":"Bearer 57988826-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}}
[2023-03-09T09:51:12.944] [DEBUG] rest-client - making axios request: {"url":"https://api.smartthings.com/rules","method":"get","headers":{"Content-Type":"application/json;charset=utf-8","Accept":"application/json","User-Agent":"@smartthings/cli/1.1.2 win32-x64 node-v16.16.0","Accept-Language":"en-US","Authorization":"Bearer 57988826-xxxx-xxxx-xxxx-xxxxxxxxxxxx"},"params":{"locationId":"ee4756eb-5723-4ed2-b08a-22a2f086f665"}}
no items found
i did notice that i had my company VPN enabled when this works, so i disconnected it, i got the original error so clearly there was a change to the company’s proxy server… i can deal with that, but i i am troubled by the fact that no rules are returned. i checked the functionality, they seem to be running just fine and they are responding as i would expect based on device states.
yes, i used the CLI with the browser authentication… given that the calls are now succeeding, i removed that configuration file (config.yaml at %LOCALAPPDATA%@smartthings\cli) and… it works, i see all my rules, all scenes so i guess the issue is resolved, other than the PAT not returning rules which it is authorized to return, but that’s a small(er) matter…
thank you so much for all your help… this was a great troubleshooting exercise