tuyapi icon indicating copy to clipboard operation
tuyapi copied to clipboard

Permission deny due to cross-region access

Open bphermansson opened this issue 3 years ago • 6 comments

I try to use tuya-cli to access devices:

DEBUG=* .npm/bin/tuya-cli wizard

But I get this: There was an issue fetching that device. Make sure your account is linked and the ID is correct.

In the debug output: Error: 1106: permission deny ... Error: GET_TOKEN_FAILED 2007, your ip(2.70.69.nnn) cross-region access is not allowed

What to do?

bphermansson avatar Dec 06 '21 21:12 bphermansson

Your devices are probably registered in a different region (through the app) than what the API supports.

IIRC there's a way to set your region when signing up, try signing up again with a different region?

codetheweb avatar Dec 07 '21 19:12 codetheweb

Seems reasonable, my account in the app has place China and I live in Sweden. I'll try to make a new account for the app, guess I have to reconnect all devices...

bphermansson avatar Dec 10 '21 21:12 bphermansson

I made sure that my region in the app is set to Norway, time zone is also set to Norway, datacentre in Tuya dashboard is set to Central Europe, but I'm still getting this error.

The only thing I can think of is that I don't have the API called IoT Data Analytics as it doesn't seem to exist anymore.

useronym avatar Dec 13 '21 20:12 useronym

Okay somehow my app got unpaired from the Tuya project. Readded it, made sure I can see my device listed on the website, and now it seems to work. Confusing error message from the API. Thanks for the great work!

useronym avatar Dec 13 '21 20:12 useronym

Solved this problem by creating a new Smart Life app account in the region "United States of America". Then added the smart device to this account and added the new (USA) account in the "Link Tuya App account" section at Tuya IoT Platform. Also make sure your region at https://myaccount.tuya.com/account is set to USA. This can be changed without creating a new developer account.

jorgnyg avatar Jan 12 '22 08:01 jorgnyg

For people like me searching for a solution. For me the solution was changing the endpoint.

See image below: Scherm­afbeelding 2022-11-11 om 20 57 10

Milofow avatar Nov 11 '22 19:11 Milofow