Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of Node.js, UI and apt-get upgrade/update does not survive restart of HB container #10

Open
michalw2-alt opened this issue Oct 7, 2023 · 17 comments

Comments

@michalw2-alt
Copy link

michalw2-alt commented Oct 7, 2023

Update of Node.js, UI and apt-get upgrade/update does not survive restart of HB container

Restart of container always resets: node.js, HomeBridge UI version and all libraries updated using: apt-get upgrade/update to outdated version.

Can you please fix this issue?

@michalw2-alt michalw2-alt changed the title Update of Node.js, UI and apt-get upgeade/update does not survive restart of HB container Update of Node.js, UI and apt-get upgrade/update does not survive restart of HB container Oct 7, 2023
@ifeign
Copy link

ifeign commented Oct 8, 2023

Why are you upgrading this way? I perform all UI and Homebridge version updates via the UI and they survive reboots just fine

@michalw2-alt
Copy link
Author

Why are you upgrading this way? I perform all UI and Homebridge version updates via the UI and they survive reboots just fine

you cannot perform update of node.js using WebUI. It's only possible using command:
"Update Node.js: hb-service update-node"
but after restart of container changes are getting lost and node.js is reverted back to old version.
Over the time some of the plugins will require higher Node.js version so - sooner or later this will became more serious problem.

Also when you update UI to most recent UI version (homebridge-config-ui-x v4.50.6) using WebUI - it also does not survive a reboot of container and is getting revert back to old version.

@ifeign
Copy link

ifeign commented Oct 9, 2023

Why are you upgrading this way? I perform all UI and Homebridge version updates via the UI and they survive reboots just fine

you cannot perform update of node.js using WebUI. It's only possible using command:

"Update Node.js: hb-service update-node"

but after restart of container changes are getting lost and node.js is reverted back to old version.

Over the time some of the plugins will require higher Node.js version so - sooner or later this will became more serious problem.

Also when you update UI to most recent UI version (homebridge-config-ui-x v4.50.6) using WebUI - it also does not survive a reboot of container and is getting revert back to old version.

Hmm, it appears you are correct. How odd, because everything else persists

@michalw2-alt
Copy link
Author

michalw2-alt commented Oct 11, 2023

Probably some of the folders within containers need to be placed locally on HAOS instead of being recreated every time HomeBridge container is started (with same old Node.js version) but not sure if this can be done to persist Node.js (as update is complex).
Otherwise HB container needs to be rebuild (with updated Node.js version) every time when some components like Node.js needs to be updated. First option is much better.

@ifeign
Copy link

ifeign commented Nov 5, 2023

There is now a new version of Homebridge that requires a higher node version. The container needs to be rebuilt

@ifeign
Copy link

ifeign commented Nov 15, 2023

I’m no developer, but I’ve been reading the documentation for HASS addons, and I believe the issue is that the persistent volume is not in /data/ in the config.yaml which is causing the issues described here upon restart

@michalw2-alt
Copy link
Author

I guess we will have to wait till issue is fixed.

@ifeign
Copy link

ifeign commented Jan 6, 2024

I guess we will have to wait till issue is fixed.

Seems that way unless someone forks this. What a shame this appears to have been abandoned… considering how active @davide125 is on GitHub. I am grateful that they created this addon, but it might be time to move on

davide125 added a commit that referenced this issue Jan 6, 2024
Update to the latest official container and move the config directory to
/data. This should improve things for #10, but note that updates
performed via the Homebridge UI still won't be persistent for now.
@davide125
Copy link
Owner

You're in luck, it's a rainy day and I managed to get my hands at last on a system that can run vscode and docker and all the stuff needed for the new devenv setup for this thing. I think I got something mostly working, will test it a bit more and cut a release if so.

@davide125
Copy link
Owner

Just released 0.1.8 updating this to the latest version. Note that this still doesn't preserve UI-triggered updates to homebridge itself; that might come in a later version if I can figure out a sane way to do so.

@ifeign
Copy link

ifeign commented Jan 7, 2024

Thank you for doing this! Really appreciate the existence of this addon

@msaario
Copy link

msaario commented Jan 7, 2024

Thank you for the great work on this update. This add-on makes Home Assistant complete and bridges the few gaps to HomeKit.

@ifeign
Copy link

ifeign commented Jan 8, 2024

Just released 0.1.8 updating this to the latest version. Note that this still doesn't preserve UI-triggered updates to homebridge itself; that might come in a later version if I can figure out a sane way to do so.

Could this be the issue regarding the update not persisting? I was looking at a different HASS addon and saw this line in the config.yaml

environment:
  # Required to write to /data
  USER_ID: "0"
  KEEP_APP_RUNNING: "1"

@michalw2-alt
Copy link
Author

michalw2-alt commented Jan 8, 2024

Just released 0.1.8 updating this to the latest version. Note that this still doesn't preserve UI-triggered updates to homebridge itself; that might come in a later version if I can figure out a sane way to do so.

Thank you for this update. Now, HomeAssistant was able to detect Homebridge as separate bridge instance and import all its devices/accessories which is great and which was not the case in the past (accessories added inside HomeBridge addon where not visible for HomeAssistant).

@michalw2-alt
Copy link
Author

michalw2-alt commented Jan 29, 2024

It seems that also in updated HB addon node.js version does not survive restart of container (after restart node.js version is reverting back to 18.19.0).

@ifeign
Copy link

ifeign commented Mar 7, 2024

I wonder if it would be worth creating a GitHub action that syncs this repo’s version of homebridge from the original source. This way we wouldn’t have to create an issue every time things are updated. I’m not crazy knowledgeable about this, but I can try submit a PR

edit: here’s a starting point

name: Sync Homebridge Docker Release

on:
  release:
    types: [created]
    # Repository that triggers the event
    repositories:
      - homebridge/docker-homebridge

jobs:
  create-release:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Create release
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: |
        # Extract relevant information from the event payload
        TAG_NAME=$(echo $GITHUB_EVENT_PATH | jq -r '.release.tag_name')
        RELEASE_NAME=$(echo $GITHUB_EVENT_PATH | jq -r '.release.name')
        RELEASE_BODY=$(echo $GITHUB_EVENT_PATH | jq -r '.release.body')

        # Create a release using GitHub API
        curl -X POST \
          -H "Authorization: token $GITHUB_TOKEN" \
          -H "Accept: application/vnd.github.v3+json" \
          https://api.github.com/repos/your-username/your-repo/releases \
          -d "{\"tag_name\":\"$TAG_NAME\",\"name\":\"$RELEASE_NAME\",\"body\":\"$RELEASE_BODY\"}"

@iSteve-O
Copy link

I am really grateful for this add-on. I have been just ignoring the nodejs update because every time I update it my BLE devices cannot connect to my pi5 anymore.

I was hoping there would be an update soon at least to the core HB container to update the nodejs version, since now one of my plugins has an update that cannot be installed. It is still working for now, but it would be great if we could update node in a persistent way.

I really appreciate your hard work on the plugin. hopefully there will be another rainy day soon... :)

PS: I wonder if the solution above would work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants