586837r / node-red-contrib-alexa-remote2

MIT License
88 stars 71 forks source link

"failed to load routines: "no body"" #191

Open GaryStimson opened 3 years ago

GaryStimson commented 3 years ago

Hi Folks, As of this evening none of my routine nodes are working and I keep getting this error when I deploy ""failed to load routines: "no body"".

I also am finding that when deploy every 1 in 5 times the authentication fails and I see an error "Error while checking Authentication: Error: no JSON".

Any ideas?

Thanks, Gary

quadhammer commented 3 years ago

As of this evening none of my routine nodes are working and I keep getting this error when I deploy ""failed to load routines: "no body"".

I don't use the routines function, but I'm getting that error as well now, every time I restart.

GaryStimson commented 3 years ago

Tried recreating the configuration node, tried removing the routine nodes and tried turning it off and back on again with no joy ;) From the error I suspect Amazon have changed their REST API and now requires a body for the command to get routines.

ammawel commented 3 years ago

I also had the error ""failed to load routines: "no body"". A manual update of the dependency "Apollon77 / alexa-remote" to new version 3.6.0 fixed the error for me.

Is there no one here who continues to maintain this node-red module and inserts the update?

brinzlee commented 3 years ago

Hi @ammawel can you explain to an idiot how you manually updated this dependency from https://github.com/Apollon77/alexa-remote Thanks

ammawel commented 3 years ago

Hi @brinzlee, I work with Windows and did it with WinSCP, because I have no idea about linux so I am a linux-idiot. There is certainly a direct way with linux.

The problem is that after an update of node-red or of a node-red-module, it will be reset to the old versions.

Good luck

brinzlee commented 3 years ago

@ammawel Thank you for the detailed instructions... I'm on windows too...I'll give it a go..... Once again thanks very much

artgreen commented 3 years ago

All these issues seem to point to (as @ammawel says) to a dependent library change. It's only 6 months since the dev disappeared - and there is this little PANDEMIC going on... so i'm not ready to say the author has abandoned. However, given the lack of any better options, I'm going to start reviewing the code in detail. If 586837r is still MIA in a few weeks, I will seriously consider forking this. For now, i just want to fix it so it works and, hopefully, 586837r comes back to us. The Dev's listed email is 586837r@gmail.com. We probably want to send some polite notes mentioning that these nodes are broken.

[Edit] Crap just saw this: https://github.com/586837r/node-red-contrib-alexa-remote2/issues/184

This is a pretty big miss on the dev's part (again, pandemic, may be not intentional) so, we need to decide if we are going to still use these nodes or, if the dev doesn't return, will someone fork this and at least get it to a working state again.

artgreen commented 3 years ago

Mentioning it here so it may help someone with immediate needs... It appears that opening an alexa node, going to the configuration node VIA THIS NODE and just closing the configuration, followed by an "update" on the original node seems to kick everything into working again. This only lasts about 24 hours. It does not work if i only open the config node - this seems to only work if go through a node that uses the configuration node.

brinzlee commented 3 years ago

@ammawel Unfortunately I couldn't find NodeRed on my Pi so I guess it must be in a docker container as I'm using HomeAssistant and it's an Addon within it. So I guess I'll just have to wait until somebody either forks this and mends it or the original developer fixes it....The last option I am not so confident upon as I see you have been raising issues for a while....

bwims commented 3 years ago

@ammawel Unfortunately I couldn't find NodeRed on my Pi so I guess it must be in a docker container as I'm using HomeAssistant and it's an Addon within it. So I guess I'll just have to wait until somebody either forks this and mends it or the original developer fixes it....The last option I am not so confident upon as I see you have been raising issues for a while....

I run dietpi, and it used to be under /home/dietpi/.node-red/node_modules However, the latest version installed under /mnt/dietpi_userdata/node-red/node_modules

So you might want to look under /mnt for something ending userdata. Just a thought!

Anyway, I can confirm that this workaround did the trick for me and I couldn't be more delighted!

Thanks @ammawel !

smiths78 commented 3 years ago

Thanks @ammawel I'm running node-red under Raspbian on my Pi and your workaround was immediately successful. I didn't even have to change file permissions.

GaryStimson commented 3 years ago

@ammawel Thanks for the detailed instructions. I did exactly what you put using WinSCP and made sure the file permissions were the same, however on restart I am still getting the same errors and no routines in the routine node. Is there a cache somewhere I need to clear? I'm running HomeAssistant OS and replaced the files alexa-remote.js, alexa-wsmqtt.js, package.json under "\config\node-red\node_modules\alexa-remote2\". I also made sure the file permissions were the same (0755). Any help would be appreciated. I'm also a Node.JS developer who is a newbie to Node-Red. If we don't get a response from the dev then I'm happy to help and fork the development. However I have no idea how to set up a new node package??

Thanks, Gary

brinzlee commented 3 years ago

@GaryStimson I followed @ammawel kind instructions too....and I have the same setup as you and am still getting the same error....as you are...:( failed to load routines: "no body"

877dev commented 3 years ago

@GaryStimson I'm having exactly the same issue lately, I tried @ammawel 's guide but using linux command line. Unfortunately still getting the same errors..

Here's a linux guide if anyone wants to try it: https://gist.github.com/877dev/536e35ef79f30cc297d313185cdd430e

ammawel commented 3 years ago

@brinzlee, @GaryStimson, @877dev I don't use Docker or HomeAssitant, I use node-red with fhem. So after manually updating after some time, are the new versions of the alexa-remote.js, alexa-wsmqtt.js files still there, or were they reset to the old ones? I have noticed that every npm-install in node-red and every update of nodes apparently checks the whole installation and resets alexa-remote to the old, originally existing files. The use of the node can only continue to work if the installation of node-red-contrib-alexa-remote2 contains the reference to the new dependencies.

877dev commented 3 years ago

@ammawel I only restarted node-red, not updated any nodes or install anything. I didn't check if the files were overwritten actually, I will do that next and let you know.

Also created issue on Apollon77's github so he is made aware of the issue, possibly he/she can help..

brinzlee commented 3 years ago

@ammawel. I followed your instructions but as you say as soon as you restart the NodeRed instance it overites the changes. So I guess HomeAssistant users can't apply the update that way

ammawel commented 3 years ago

@brinzlee No, I did not say that changes are overwritten by a restart of node-red - but e.g. by other installations in node-red, perhaps also by HomeAssistant or Docker, check the version of the files. It's just a manual exchange of files that may be automatically undone, not a real update. Actually, this makes sense and protects against manipulation. The actual installation of node-red-contrib-alexa-remote2 must be changed on npmjs.com, e.g. the corresponding file package.json, which contains the reference to the dependencies.

877dev commented 3 years ago

So after manually updating after some time, are the new versions of the alexa-remote.js, alexa-wsmqtt.js files still there, or were they reset to the old ones?

@ammawel for me the new files seem to have persisted, and the permissions are the same. Plus I checked with WinMerge and the old and new files are different....

image

ammawel commented 3 years ago

@brinzlee, @GaryStimson, @877dev I'm sorry, but I can't help with HomeAssistant and Docker.

We need a real update of the node node-red-contrib-alexa-remote2 with updated dependencies.

877dev commented 3 years ago

Fair enough, although Docker is not really any different if you don't know about it...

Anyhoo, it's kinda working for me now, not getting any "no body" errors for a while.

However still getting "Error while checking Authentication: Error: no JSON" every so often, can be fixed with redeploy...

juancgalvez commented 3 years ago

Following @ammawel instructions fixed this issue for me on my Raspberry Pi. Thank you.

877dev commented 3 years ago

Following @ammawel instructions fixed this issue for me on my Raspberry Pi. Thank you.

@juancgalvez Were you getting ""Error while checking Authentication: Error: no JSON" " errors as well?

Apollon77 commented 3 years ago

Error sfrom routines are fixed by updating alexa.remote to 3.6.0 because AMazon changed stuff.

Errors on Authorization also happened sometimes this week, but I got noofficial report on them, so seems like "fixed themself over time because amazon broke stuff" or such .. no idea

juancgalvez commented 3 years ago

@877dev No, I didn't.

kuradi commented 3 years ago

Error sfrom routines are fixed by updating alexa.remote to 3.6.0 because AMazon changed stuff.

Errors on Authorization also happened sometimes this week, but I got noofficial report on them, so seems like "fixed themself over time because amazon broke stuff" or such .. no idea

how to update if im using nodered in docker?

dpembo commented 3 years ago

Error sfrom routines are fixed by updating alexa.remote to 3.6.0 because AMazon changed stuff. Errors on Authorization also happened sometimes this week, but I got noofficial report on them, so seems like "fixed themself over time because amazon broke stuff" or such .. no idea

how to update if im using nodered in docker?

assume your flows are in a mapped directory, if so, you can just edit the dependency and update the remote2 module.

dpembo commented 3 years ago

I've forked and just modified here: https://github.com/dpembo/node-red-contrib-alexa-remote2

Modified the package dependency to 3.6.0 and bumped the version of this package up to 3.11.0

Tested independently in a clean build and it seemed to work ok, but my live instance runs in docker, and didn't want to redeploy my mapped directory so just manually edited this.

Anyone, please feel free to try this and let me know if it works - you'll need to install it via npm and point to the URL for now, versus an install inside node-red.

Assuming it works, if @586837r returns at any point, I'll create a pull request on this, otherwise I'll push forward with the fork and finalise this, though it'll probably need a new contrib name to differentiate from the original.

cakebake commented 3 years ago

https://flows.nodered.org/node/node-red-contrib-alexa-cakebaked

The same error occurred with me. Since I had promised my wife that she would no longer overhear the phone when I was listening to loud music, ...

In short: Install via the UI via node-red-contrib-alexa-cakebaked.

@586837r Are you still updating the project? If so, I would remove my fork again.

cakebake commented 3 years ago

@dpembo haha, double fork ftw! But I was faster on npm and created a package flow right away. 😎 🍰

dpembo commented 3 years ago

@dpembo haha, double fork ftw! But I was faster on npm and created a package flow right away. 😎 🍰

great minds and all that 😄

cakebake commented 3 years ago

great minds and all that 😄

Sometimes ;)

... and works! I hope I didn't bother my wife with the voice announcement. 😨

image

... Alexa Event, too

image

@586837r thank´s for your work!

brinzlee commented 3 years ago

Thanks for the great work Guys....@cakebake when I go to install your version I get that there is a conflict of course because alexa-remote2 is already installed....Do you know if I delete the old one and install yours will the original flows be messed up that I have already already created referencing alexa-remote2 ?

ammawel commented 3 years ago

@brinzlee I did it this way:

cakebake commented 3 years ago

Hi! I had to delete my old nodes (and the configuration node). If you install the new package and set it up like before, it will reuse the authentication. Unfortunately I can't change that. I guess you could remove and install the new package via CLI, so you wouldn't need to remove anything in your UI. Another possibility is to export your relevant sequences in the UI and import it again after the installation.

brinzlee notifications@github.com schrieb am Sa., 30. Jan. 2021, 09:44:

Thanks for the great work Guys....@cakebake https://github.com/cakebake when I go to install your version I get that there is a conflict of course because alexa-remote2 is already installed....Do you know if I delete the old one and install yours will the original flows be messed up that I have already already created referencing alexa-remote2 ?

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

brinzlee commented 3 years ago

@cakebake I have followed all your instructions to the letter but am still getting the following error in debug

failed to load routines: "no body"

Is this what you are getting

Sorry to be a pain

moryoav commented 3 years ago

@brinzlee I did it this way:

  • export all flows / tabs as file
  • insert empty flow
  • delete all other flows
  • deploy
  • goto menue, manage palette, delete node-red-contrib-alexa-remote2, install node-red-contrib-alexa-cakebaked
  • import flows from file

Thank you so much! Followed these instructions (+had to do pm2 restart red on my windows installation), worked wonderfully. Hopefully you'll also be able to keep maintaining this in the future. Thanks!

brinzlee commented 3 years ago

@moryoav thanks I did a restart of NodeRed and that cured the error.......@cakebake thanks for the updated code you're a superstar...!!!

877dev commented 3 years ago

I guess you could remove and install the new package via CLI, so you wouldn't need to remove anything in your UI.

@cakebake brilliant work thanks for you effort! I would be interested how to update via CLI. Otherwise I will export/reimport the relevant flows...

nj2299 commented 3 years ago

@cakebake - thanks for updating this, i've been been throwing in catch blocks everywhere for error handling because I keep getting the same error as everyone else.

does anyone know if the "on device activity" is more stable? i've been trying to use it for context aware command but it's been really inconsistent in reporting on the activity. In the 3.1.1. version it would only work for a few minutes at a time.

MonkeyBusiness1 commented 3 years ago

@cakebake - thanks much for helping to keep our flows working, the update fixed the "no body" issue for me.

There does seem to be something new now, as I have a flow that updates the cookie on a regular interval, and when that runs an error is thrown...

"failed to load routines: "routines.map is not a function""

I am not sure what if any problems this is causing as the cookie appears to update, but is always accompanied by this error, which also occurs when node red is launched.

Should this be a new issue, or a continuation of #191?

Dunc80 commented 3 years ago

@cakebake thank you!

The command line interface commands to install cakebake's solution are:

node-red admin remove node-red-contrib-alexa-remote2
node-red admin install node-red-contrib-alexa-cakebaked

I did an export of my flows through the GUI first just in case, but I didn't need it, it just worked after these CLI commands and a redeploy

MonkeyBusiness1 commented 3 years ago

@Dunc80 - That's a real handy way to do the update, so we all appreciate that!

I did it by the numbers per @brinzlee and deleting your flows takes a great amount of courage.

You know for certain you can import them back in without issue, but then there is murphy lurking about!

MonkeyBusiness1 commented 3 years ago

@bwims - You should try the update from @cakebake

Check out the most recent posts regarding this, and make sure to export all of your nodes prior to making any changes just in case you need to import them back later on. Than after doing that,@Dunc80 suggested installing the update as per below...

The command line interface commands to install cakebake's solution are:

node-red admin remove node-red-contrib-alexa-remote2 node-red admin install node-red-contrib-alexa-cakebaked

bwims commented 3 years ago

@bwims - You should try the update from @cakebake

Check out the most recent posts regarding this, and make sure to export all of your nodes prior to making any changes just in case you need to import them back later on. Than after doing that,@Dunc80 suggested installing the update as per below...

The command line interface commands to install cakebake's solution are:

node-red admin remove node-red-contrib-alexa-remote2 node-red admin install node-red-contrib-alexa-cakebaked

Thanks! I will take a look. Working fine at the moment, though. I hope the developer is ok and will return at some point.

DeepHyperspace commented 3 years ago

ErrorAlexaRemote

Hey i get the same error. failed to load routines: "no body"

i restarted node red, my whole raspberry pi, tried new authentication, doesnt work at all Is there a workaround now?

Padm59 commented 3 years ago

Same here, getting all the time errors and nothing works anymore.

bwims commented 3 years ago

I don't get why people aren't bothering to read how to workaround the problem.

1) The developer is absent, for reasons unknown 2) Changes in Alexa internals broke the code 3) There are two ways to deal with the problem in the meantime.

@Padm59 @DeepHyperspace Search for @cakebake for the latest one.

MonkeyBusiness1 commented 3 years ago

It is a bit mystifying that the @cakebake and other solutions are not being noticed.

That being said, it will most surely get rid of the primary issue that is bringing folks here.

I used the @cakebake update and it solved it for me, however it caused a new problem for me.

I have a flow that updates the cookie on a regular interval, and when that runs an error is thrown...

"failed to load routines: "routines.map is not a function""

Has anyone else noticed this issue which started after I performed the @cakebake update?

I am hesitent to start a new issue as it may be related to the update and most likely belongs in this thread.

AleksCee commented 3 years ago

@MonkeyBusiness1 I have updated in Docker with this commands, because the node-red-admin says: „it‘s in use“:

cd /data
npm remove node-red-contrib-alexa-remote2
npm install node-red-contrib-alexa-cakebaked

and it seams to work fine. But the event node „On device Activity“ which I use to response on speak commands, didn‘t work. A redeploy says 3 times auth. error but at last it‘s work for speak output but still not for listening on activity. But the status of this node is ok:

8391904A-0680-4253-B3AC-3D58D1FD9F25