node-red-contrib-alexa-remote2 icon indicating copy to clipboard operation
node-red-contrib-alexa-remote2 copied to clipboard

Error: no crsf found

Open ThomasPoett opened this issue 5 years ago • 29 comments

since the last two versions i experience the following wired issue. Reproduceable:

  • refresh cookie - (result: working between 1-3 days)
  • it stops working
  • initiate account - (no crsf found error)
  • refresh cookie: (no crsf found error) Workaround: a) reinitiate and or refresh cookie a few time over again b) restart node red No CRSF found

Environment: Raspberry 3 RaspMatic: 3.47.22.20191026 Node Red: 5.2.3 Alexa Remote 2: 3.9.0

ThomasPoett avatar Feb 15 '20 09:02 ThomasPoett

I've just started experiencing this as well over the last couple of days. It didn't start after updating versions (which I did minutes after you released 3.9.0), but rather seems to have cropped up some time over the last two days.

I attempted the following code-less workarounds to no avail:

  • Restarting Node-Red
  • Reinitializing the account
  • Setting the account to use a different file path

Not sure what's wrong here just yet, but still looking.

zkniebel avatar Feb 15 '20 22:02 zkniebel

After some more experimenting, I was not able to circumvent this while using the "proxy" authentication mode. I was, however, able to work around it by using Cookie authentication and copying my cookie in from one of the requests I made while logged into https://alexa.amazon.com.

zkniebel avatar Feb 15 '20 22:02 zkniebel

@zkniebel well with the cookie I experimented too. The problem with this on Raspmatic is, that the cookie never get refreshed proper. Meaning, after approx. 5 days I need a manual refresh and then, after a few more days i need to apply a new cookie manually. So the Proxy Auth was working literally better. That why it should be proxy Auth.

ThomasPoett avatar Feb 16 '20 06:02 ThomasPoett

Maybe, I found with Raspmatic a tiny workaround working approx. 50%. after restarting node-red i get a DNS error for amazon.com for about 1-2 min, after this the initialization is working and the crsf is gone for the next 1-3 days. So is very unpredictive when the crsf error appears exactly again. @zkniebel could you test this with restarting node-red

ThomasPoett avatar Feb 16 '20 06:02 ThomasPoett

I’m on Hassio, and confirmed that the restart-wait (gave it 30 minutes) workaround is not working for me. Odd.

zkniebel avatar Feb 16 '20 12:02 zkniebel

i am also getting this error.

stoneobscurity avatar Feb 16 '20 15:02 stoneobscurity

Me too - I'm guessing Amazon changed something ?

smcgann99 avatar Feb 19 '20 19:02 smcgann99

Hi folks, I guess we Need to wait for @586837r providing us with an answer. I'm not fit enough reading the source Code anymore :(

ThomasPoett avatar Feb 20 '20 09:02 ThomasPoett

Hey, there are a lot of open issues about reliability of the authentication. It's probably about the dependency "alexa-remote" or how i interact with it. Thing is i don't use these nodes anymore at the moment so i would appreciate if someone else could look into that.

586837r avatar Feb 21 '20 20:02 586837r

Well, I would help, only my DevOps skills are a little outdated. Sure if someone wants to work together on it, please ping me.

ThomasPoett avatar Feb 22 '20 08:02 ThomasPoett

If you want a workarround to refresh amazon auth cookie this are the steps.

  • Look for a file called authFile. If you are using docker it is located at your home when you get into your instance.
  • Remove it
  • Restart NodeRed and make the proxy validation. It will copy a new fresh cookie from amazon in the authFile

Regards

ljpaff avatar Feb 26 '20 17:02 ljpaff

I have not been able to get the cookie working for some time by using the appropriate URL of my raspberry pi. I tried again today and now get the csrf not found. @ljpaff will authFile be located on my PC (that I browse with) or the pi that runs node-red

grumpazoid avatar Mar 02 '20 18:03 grumpazoid

@ljpaff will authFile be located on my PC (that I browse with) or the pi that runs node-red

On the pi

ljpaff avatar Mar 06 '20 15:03 ljpaff

@ljpaff will authFile be located on my PC (that I browse with) or the pi that runs node-red

On the pi

could you give a detailed step by step for the linux/docker noobs and illiterate for how to find and delete the authfile please?

thanks in advance

bunnosaurusrex avatar Mar 07 '20 01:03 bunnosaurusrex

I have searched the entire pi file structure (using filezilla) and cannot find authFile? I have found folders /home/pi/.node-red/node_modules/alexa-cookie2 and /home/pi/.node-red/node_modules/alexa-remote2.

Any clues please?

grumpazoid avatar Mar 07 '20 10:03 grumpazoid

@grumpazoid same with me. I'm using PI3 with RaspMatic, even I told the node where to store the Auth-File but I never saw or found any. My programming skills are a little outdated, so I can't find the where to save function in the source code.

ThomasPoett avatar Mar 08 '20 10:03 ThomasPoett

I just worked on it a little right now. Wired, I didn't restart node-red, neither I injected refresh nor Initialize - after typing in the proxy credentials, it work without crsf error. I will now observe what it behaves. I had a time, injecting refresh every 48 hrs.

ThomasPoett avatar Mar 08 '20 12:03 ThomasPoett

Dear,

in my case you have to do a "docker exec -it <instance-name> /bin/bash" and them in the same directory making a "ls" command you see "authFile"

image

Then you only have to do a "docker restart <instance-nodered>"

Regards

ljpaff avatar Mar 10 '20 09:03 ljpaff

i keep getting this as well and i can not find the authFile anywhere. i do know this is a hass.io that was installed on proxmox. there was a script that was ran. node red is installed and running on docker.

dfgas avatar Mar 20 '20 20:03 dfgas

Solution:

Choose a path like /home/echo/ and create a empty file named cookie.txt in the echo folder. You end up with /home/echo/cookie.txt then set this as the File Path. It will complain about Empty Json but it will initialize and work.

IFTTD avatar Mar 25 '20 04:03 IFTTD

@TheCookieMonster70 I was just about to try your solution. I just tried getting the cookie again by going to local address and logging in to Amazon and this time it worked !!! ?

I've now added the path as you suggested. Got cookie again. Still working. Thanks for this.

grumpazoid avatar Mar 25 '20 14:03 grumpazoid

I have tried the suggestions above but still get the "no csrf found" error!

ghayne avatar Mar 28 '20 15:03 ghayne

the solution dont work for me

ctyd avatar Mar 29 '20 21:03 ctyd

In path I did /config/alexa.txt This is on hassio though

On Sun, Mar 29, 2020, 4:36 PM ctyd [email protected] wrote:

the solution dont work for me

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/586837r/node-red-contrib-alexa-remote2/issues/102#issuecomment-605705599, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFWQFMRBCMJPH5MGHFCFITRJ65N5ANCNFSM4KVW5WMA .

dfgas avatar Mar 29 '20 22:03 dfgas

for me this is not working.

scobby avatar Apr 01 '20 19:04 scobby

what worked for me is just restarting node-red. lets see how long this helps.

scobby avatar Apr 01 '20 19:04 scobby

After creating the cookie file I put the refresh to 5 days. 8 days later the nodes still say ready!!

grumpazoid avatar Apr 02 '20 09:04 grumpazoid

mine will say ready sometimes but they surely are not doing what is commanded.

dfgas avatar May 06 '20 11:05 dfgas

mine will say ready sometimes but they surely are not doing what is commanded.

It definitely seems to fail silently.

Prog72 avatar May 06 '20 19:05 Prog72