hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
526 stars 122 forks source link

After update to 16.0.1 all flows gone #1736

Closed Bloodpack closed 8 months ago

Bloodpack commented 10 months ago

Did update from 15.x to 16.0 and then to 16.0.1 and all my flows are gone. tried to restore backup from 15.x and nodered does not start anymore.

EDIT: Read about the solution here: https://github.com/hassio-addons/addon-node-red/issues/1736#issuecomment-1812437543

thecem commented 10 months ago

How to restore only the config folder?

Cadabena commented 10 months ago

OPEN COMMENT @frenck Dear Frenck, my wife told me all our automations were broken when I got home today. One simple restore from daily backup, and all was fine. She says it made her realise just how awesome our automations are throughout the day, and says a huge massive thank you for everything you do!

8OND007 commented 10 months ago

How to restore only the config folder?

I copied my full backup tar file locally. Stopped nodered addon. Went to HA share folder over samba : \homeassistant\addon_configs\a0d7b954_nodered deleted alle files under that directory. Then copied all files from the tar under \data\node-red\ to the above path. took a while since there are several thousands of files. started NodeRed addon All flows are back :-)

I was already looking at Zigbee netwerk when I noticed my automations did not run anymore, but now the problem was an emty NR.

Don't feel bad Frenck, it can happen to anybody ;-) thx for your great work ! This again puts making backups nr 1 in everybodies to do list.

Cadabena commented 10 months ago

To help anyone else restoring, all I had to do was restore these two options:

image

I was then able to update to 16.0.2 just fine :)

Igloczek commented 10 months ago

Send this guy some money via GitHub Sponsors, he is doing great work here, deserves it. https://github.com/sponsors/frenck

Caligo82 commented 10 months ago

OPEN COMMENT @frenck Dear Frenck, my wife told me all our automations were broken when I got home today. One simple restore from daily backup, and all was fine. She says it made her realise just how awesome our automations are throughout the day, and says a huge massive thank you for everything you do!

It's off topic, but still 😄 I shared this with my wife, reproachfully asking for her praise. Now she is actually debating whether your wife has ever said something like that. 🤣

zajaaczki commented 10 months ago

After back to 15.1.1 my node red red can't start Error loading settings file: /etc/node-red/config.js update from restored 15.1.1 to 16.0.2 nothing all my flows gone.

radionerd1 commented 10 months ago

ℹ️ The solution

Important, v16.0.0 has an issue with credentials secret (see #1733 for the original report and the fastest resolution I could provide) and v16.0.1 has an issue with failing to detect the migration already happened.

That is unfortunate, but it did happen and didn't show up in testing, unfortunately 😭

If you have upgraded from v15 to v16.0.0 or v16.0.1 you will encounter a migration problem.

To solve this:

1. Restore a backup **(node-red + home assistant config as that is where the flows are stored)**

2. Clear out the Node-RED folder in `/addon_configs/`, which contains the invalid migration. You can access this folder using the terminal add-on or using the `addon_configs` share provided by the Samba add-on.

Once you are back up and running on the previous version, upgrade to v16.0.2.

I've addressed the issue as quickly as possible, but I cannot revert what has been done.

I'm mostly mad at myself right now, and I'm deeply sorry this happened.

Sorry for the issue this might have caused for you 🙏

../Frenck

I am running HA on Blue, I'm not a coder, but can follow visual examples well.

SynoUser-NL commented 10 months ago

flows.json and flows_cred.json are the only files you really need, both you can find in any core (and full) backup. Obviously, the more recent the backup file, the better.

If you're stuck without any flows on (an otherwise normally functioning) NodeRED v16.0.2 and have a core backup, you can:

@frenck : thanks for the quick fix and your time and effort for maintaining all these packages. Glad the Node-RED backup now contains the flows.json file (and the full NodeRED config, afaics). Great job!

Sesjusz commented 10 months ago
  • un-tar (using 7-zip or similar) the tar-file to a folder, this will give you a homeassistant.tar file

How to un-tar password protected homeassistant.tar ? I set in HA that my files should be password protected as I am uploading backups to google drive. I downloaded backup, and I want to un-tar it in windows. 7zip and winrar not asking me for password, just giving me informaiton that file is corrupted, in the same way it looks like that for each full bacup file, each one is password protected. How to trigger in windows asking me for a password to un-tar backup file?

I am fighting with it 8th hour today. I had every automation configured in Node-red

jimbray2701 commented 10 months ago

Can I just say a big thankyou to everybody and @frenck . Yes there has been a problem, which I myself has suffered, but it's all sorted. But if it wasn't for the guys who bring us this add-on and HA we would not have the automations in the first place. Thank you for your hard work, we do appreciate you all. :-)

Caligo82 commented 10 months ago
  • un-tar (using 7-zip or similar) the tar-file to a folder, this will give you a homeassistant.tar file

How to un-tar password protected homeassistant.tar ? I set in HA that my files should be password protected as I am uploading backups to google drive. I downloaded backup, and I want to un-tar it in windows. 7zip and winrar not asking me for password, just giving me informaiton that file is corrupted, in the same way it looks like that for each full bacup file, each one is password protected. How to trigger in windows asking me for a password to un-tar backup file?

I am fighting with it 8th hour today. I had every automation configured in Node-red

Download and install GNU Tar for Windows from sources like GnuWin32 or Cygwin. These versions usually support password-protected TAR files.

Once installed, open Command Prompt and navigate to the directory containing the homeassistant.tar file.

Extract Using the following command:

tar -xf homeassistant.tar

If it's password protected, it should prompt you for the password...

Sesjusz commented 10 months ago

tar -xf homeassistant.tar

Thank you Caligo,

I installed cygwin and then in colsole tried:

kurki@Komputer /cygdrive/c/Users/kurki/Downloads/Full_Backup_2023_11_09_14_16_23
$ tar -xf homeassistant.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

kurki@Komputer /cygdrive/c/Users/kurki/Downloads/Full_Backup_2023_11_09_14_16_23
$ file homeassistant.tar.gz
homeassistant.tar.gz: data

I don't have more ideas how I can un-tar it :(

vschild commented 10 months ago

https://github.com/sponsors/frenck

this works perfect

Caligo82 commented 10 months ago

tar -xf homeassistant.tar

Thank you Caligo,

I installed cygwin and then in colsole tried:

kurki@Komputer /cygdrive/c/Users/kurki/Downloads/Full_Backup_2023_11_09_14_16_23
$ tar -xf homeassistant.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

kurki@Komputer /cygdrive/c/Users/kurki/Downloads/Full_Backup_2023_11_09_14_16_23
$ file homeassistant.tar.gz
homeassistant.tar.gz: data

I don't have more ideas how I can un-tar it :(

Well at least outside of homeassistant this seems more complicated than anticipated. I found this thread regarding the issue:

https://community.home-assistant.io/t/get-files-from-password-protected-snapshot/

Can't you just load the backup in homeassistant backup manager and decrypt (restore) it there to get your files? It shouldn't be too much of a hassle over ssh...

Edit: I also found this tool, seems to work with windows. But does it work with your backup? 🙄 https://pypi.org/project/decrypt-ha-backup/

SilentScreamer1991 commented 10 months ago

Hey guys, too bad this happend, panicked a bit, but I see it is worked on. I saw the solution, but by addon_configs seems empty and I also can't find the flows.json as above users mentioned. I don't know how I can resolve this issue but I am so afraid I lost a lot of my automations right now, and I don't know if I can find it in my backups anymore. Is there a possibility that there will be an update that magically retrieves my flows.json and does show my addon_configs (or better, retrieve it by an update?). Thanks in advance, thanks for the energy used!

ikke-zelf commented 10 months ago

@SilentScreamer1991 Mine addon_configs folder was empty also.

sphinxlady commented 10 months ago

The bug that caused this was fixed i believe but the

@SilentScreamer1991 Mine addon_configs folder was empty also.

* I just created a folder in there called 'addon_configs\a0d7b954_nodered'

* Then I pasted the retrieved two json files in there (they were located in the unzipped full backup file in the homeassistant.tar.gz file in the following location: \homeassistant.tar\data\node-red\ )

* Then I needed to update the node-red installation first prior to starting (as it could not start before update).

* Then I started Node red.

* Then I opened node-red (still no flows).

* Then I used Import function in node red to import the 'flows.json' file.
  that worked for me.

The bug that caused this was fixed in the updater but the damage resulting from the bug wasn't.

Ikke fix should restore things for those that didn't have a backup of the flows.

SilentScreamer1991 commented 10 months ago

To help anyone else restoring, all I had to do was restore these two options:

image

I was then able to update to 16.0.2 just fine :)

Thanks @ikke-zelf @sphinxlady but i later saw this comment and this helped me out!!! I only restored node-red but need to restore home assistant too! Thanks @Cadabena and @frenck for trying to fix it asap!

kdober commented 10 months ago

Hi. Having same issue after updating to 16.0.1.... As mentioned above restoring to prior 15.1.1 didn't work. Addon doesn't start. I downloaded yesterday morning backup to look for the files and follow the instructions from @SynoUser-NL post. I went back to installing 16.0.2. However, I'm not sure how to proceed.

1) I have a flows.json file in the backup. But i don't have any flows_cred.json within the node-red folder in the backup. 2) Most important. I dont see any 'addon_configs\' folder within my Config (I'm using VSC). Am I supposed to create such folder? Or is it located somewhere else?

Thanks Cristian

radionerd1 commented 10 months ago

SynoUser-NL's tip worked for me: dropped flows.json and flows_cred.json into the new nodered folder within addon_configs I was able to manage palette to find and install most of my old modules that were missing. Still have to modify 14 flows "stoptimer3" was popular with me. Looking for a timer that will do the same action.

Thanks

MaCo69 commented 10 months ago

Hi... My flows are back... What I done...

  1. Update Node-Red from not working 16.0.1 to 16.0.2 (16.0.2 is working without flows)
  2. Restore last Home sistant core
  3. Restore Node-Red 15.1.1 (all flows are back)
  4. Update Node-Red 16.0.2
  5. Update homeassistent core
  6. All working again
alfbas commented 10 months ago

ℹ️ The solution

Important, v16.0.0 has an issue with credentials secret (see #1733 for the original report and the fastest resolution I could provide) and v16.0.1 has an issue with failing to detect the migration already happened.

That is unfortunate, but it did happen and didn't show up in testing, unfortunately 😭

If you have upgraded from v15 to v16.0.0 or v16.0.1 you will encounter a migration problem.

To solve this:

1. Restore a backup **(node-red + home assistant config as that is where the flows are stored)**

2. Clear out the Node-RED folder in `/addon_configs/`, which contains the invalid migration. You can access this folder using the terminal add-on or using the `addon_configs` share provided by the Samba add-on.

Once you are back up and running on the previous version, upgrade to v16.0.2.

I've addressed the issue as quickly as possible, but I cannot revert what has been done.

I'm mostly mad at myself right now, and I'm deeply sorry this happened.

Sorry for the issue this might have caused for you 🙏

../Frenck

Form my experience as programmer years ago......shit happens from time to time :-) Do not worry, there's a solution

Zagitta commented 10 months ago

This is a good reminder for everyone to disable automatic updates. This addon isn't the first nor the last to push an update that breaks everyone's home automation 🙂

It's deeply ingrained in the entire ecosystem's culture to "move fast and break things" at this point, even core homeassistant loves making breaking changes that require manual intervention in one way or another

BobRathke commented 10 months ago

UPDATED 11/16/2023 8:39 EST

After a series of full restores, and attempted/failed recoveries, I am back to 15.1.1 working/starting correctly with all my flows. I am not sure what the "magic sauce" was, but I am going to let it run a day or two before attempting the 16.X upgrade again.

Good luck friends, this was a rough one! Years of flows are once again running here.


After full restore of HA & NR to 15.1.1, NR IS running and can be accessed directly via IP (http://192.168.50.200:1880/#flow/8fb13690.c3e5e), but NOT Via HA dashboard. HA reports service will not start, but it is started and running.

Please advise. I am unable to move forward or backward.

I have exported all my flows and just need to get NR updated and running properly at this point.


I am still struggling to recover back to my 15.1 OR upgrade to 16.2

After a failed upgrade from 15.X I have attempted to do full restores and NR still fails to start after full restore back to 15.X. It appears node red is "working" but the NR logs stop and it appears to Hang. Flows are still running, but HA reports NR is not started?

After restoring back to 15.X I do not see the new addon folders to execute suggested resolution. I even restored from several days ago (Full) with no joy.

Help.......

mikebaileyz commented 10 months ago

I am sorry but this didn't work for me. I have restored back to V15 and the HA 2023.11.2 then looked in \addon_config\ but it is empty. Tried V16.0.2 but still won't start I am really lost here and need some detailed help I have thousands of hours of NR work but cannot access them

borfang commented 10 months ago

If Node-RED fails to start after an update, you can follow my solution. First, restore to a version that works correctly, uninstall Node-RED 15.1.1, and then follow these steps in the Advanced SSH & Web Terminal:

Navigate to the home assistant directory:

cd /homeassistant

image

List the contents to identify directories related to Node-RED:

ls -llh Identify directories related to Node-RED (e.g., node-red and node_modules).

Rename the Node-RED directories for backup:

mv node-red node-red_bak
mv node_modules node_modules_bak
image

Reinstall Node-RED version 16.0.2.

After installation, perform basic configuration and check if Node-RED starts correctly.

Once confirmed, stop Node-RED and copy the flows configuration from the backup:

cd /addon_configs
ls
cd a0d7b954_nodered
cp /homeassistant/node-red_bak/flows.json .
image image

Start Node-RED and reinstall any missing nodes.

After confirming everything is working fine, you can remove the backup directories:

rm -rf /homeassistant/node-red_bak
rm -rf /homeassistant/node_modules_bak

This process involves backing up and restoring Node-RED directories, reinstalling the updated version, copying the flows configuration, and ensuring that all necessary nodes are installed.

mikebaileyz commented 10 months ago

I am really grateful for your help but there is lots in your note I don’t understand I have not been able yet to find a previous version of node Red that worksI have tried partial restoring from my daily backups but all fail to startRemove node red? Does this mean uninstall or delete or what?Will I lose my flows if I delete it?I don’t understand ls or mv or cp or any of these functionsAre you working from terminal?My lack of knowledge here makes me so scared that I will screw it upRegardsMikeOn 16 Nov 2023, at 12:05, borfang @.***> wrote: If Node-RED fails to start after an update, you can follow my solution. First, restore to a version that works correctly, remove Node-RED 15.1.1, and then follow these steps in the terminal: Navigate to the home assistant directory: cd /homeassistant List the contents to identify directories related to Node-RED: ls -llh Identify directories related to Node-RED (e.g., node-red and node_modules). Rename the Node-RED directories for backup: mv node-red node-red_bak mv node_modules node_modules_bak

Reinstall Node-RED version 16.0.2. After installation, perform basic configuration and check if Node-RED starts correctly. Once confirmed, stop Node-RED and copy the flows configuration from the backup: cp /homeassistant/node-red_bak/flows.json /addon_configs/new_node-red_folder/. Start Node-RED and reinstall any missing nodes. After confirming everything is working fine, you can remove the backup directories: rm -rf /homeassistant/node-red_bak rm -rf /homeassistant/node_modules_bak

This process involves backing up and restoring Node-RED directories, reinstalling the updated version, copying the flows configuration, and ensuring that all necessary nodes are installed.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

droneman83 commented 10 months ago

can some one make small clip on how to fix it again, i have triede to restore from back up. once i start up NR it do look like a normal start up (reading 205 nodes) once it start up i just show Credential erro. I might just do somthing wrong??

Caligo82 commented 10 months ago

I wonder, is there a scenario where the flows.json got wiped by the update process? I have it all updated and working again, when I try to get to these old files in my updated system, they're gone. When I open my backups from a few days ago, they're still there (in the path where they're not anymore now). This is unfortunate as it means if you didn't have a homeassistant core backup laying around somewhere... flows.json is gone...

marc115uk commented 10 months ago

Every time try to use a back up. I select home assistant config and node red 15, however once it has finished restoring back up I open home assistant and still have node red 16.0.2 installed? also have a warning Your flow credentials file is encrypted using a system-generated key. If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials.

SynoUser-NL commented 10 months ago

SynoUser-NL's tip worked for me: dropped flows.json and flows_cred.json into the new nodered folder within addon_configs I was able to manage palette to find and install most of my old modules that were missing. Still have to modify 14 flows "stoptimer3" was popular with me. Looking for a timer that will do the same action.

Thanks

Note that the actual name of the node (once added with Palette Manager) can be different from the name it is displayed as in Palette Manager. So if you install a node "stoptimer" from Palette Manager, the node that is added may very well be stoptimer3. The actual name of the node is displayed briefly on installation, and after installation you will find it in the node list.

After installation of a node, flows will automatically update to use it on the next deployment of your flows.

CrallH commented 10 months ago

I just did this, was I just lucky to get it all back? https://community.home-assistant.io/t/after-update-to-16-0-0-all-flows-and-notes-are-gone/641103/45?u=christian_hollbjar

BjornBP commented 10 months ago

Followed Frenck's instructions to the letter. Several times. No joy. What eventually fixed it was a hardware power-down and reboot. Previously we were simply doing a soft reboot and something must have remained in memory, causing the fix not to have any effect. Thanks Frenck for being on top of this issue and supporting it so well.

a24me commented 10 months ago

What I did...

  1. Restore the backup. I restored the more recent full one before the incident, but I suppose that the NodeRed one could also be enough. If you restore only the node red backup, possibly you will need to use the Terminal addon or the SAMBA addon (share) or a SSH connection, to delete the directory named xxxxxxxx_nodered under the /addon_configs/ directory, before the restore.
  2. System -> Power button -> Advanced options -> Reboot system.
  3. Wait to load everything and check that everything works.
  4. System -> Power button -> Advanced options -> Shut down system.
  5. Wait for about 10 min for the system to shut down.
  6. After system shut down power off the device.
  7. Power on the device.
  8. Apply all pending updates.

Voila, all back and working in an extremely large and complicated setup! Fingers crossed!

klio-klio commented 10 months ago

I've got Node Red working again so far. I get error messages when deploying. Screenshot 2023-11-19 220623 Does anyone have the problem?

henriklund commented 10 months ago

Think I found out why: Have a look at this issue; looks as this is 'working per design'. After changing the deploy model back to 'Modified Nodes' (did not note it had changed), the errors have gone.

mikebaileyz commented 10 months ago

I wanted to update on my situation having been frustrated for several days trying to solve this and hope it may help some others. Having followed the instructions and restored from back-ups still couldn't get v15.1.1 NR UI to start. All my flows were working in the background. I was stuck until I read in this post that someone did a system re-boot, (not a restart). Tried this and it started working! I was then able to upgrade to v16.0.2 and it also started OK. Hope this helps anyone else who thinks they have followed all the instructions but cannot get NR to start.

github-actions[bot] commented 9 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

aavosnl commented 9 months ago

is there any update on the problems after the update node-red-contrib-home-assistant-websocket ? trying everything that others have done but with no positive results so far

PrathikGopal commented 9 months ago

Manually installed the node-red-contrib-home-assistant-websocket module to get the flows working, but that’s a temp fix. Hopefully we have a better solution.

lensherm commented 8 months ago

is there any update on the problems after the update node-red-contrib-home-assistant-websocket ? trying everything that others have done but with no positive results so far

In the same boat here. Got to 16.0.2 without realizing there were any issues. At that point I updated the node-red-contrib-home-assistant-websocket, which resulted in missing nodes and missing node-red-contrib-home-assistant-websocket.

henriklund commented 8 months ago

At that point I updated the node-red-contrib-home-assistant-websocket

A few things... Do you have a backup and considered reverting? Secondly, (regarding the websocket) there are a few issues on that:

For me, the lesson learned is to never update the websocket through the palette manager in NodeRed.

indicato commented 8 months ago

Sorry , when will it fixed .. The solution is very easy .. (i hope so)

node-red-contrib-home-assistant-websocket need : Node-RED v3.1.1+ but the addon has only v3.1.0.

So what´s up with an update ?

Thanks Lars

frenck commented 8 months ago

Going to close this issue, as it has been open long enough at this point.

The latest comments are not related to this specific issue presented here.

../Frenck

indicato commented 8 months ago

Thanks for updating .