Zwave JS UI - Syntax error when running Update #113

Closed
opened 2026-02-04 16:41:22 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @WorldOfGZ on GitHub (Nov 29, 2024).

Please verify that you have read and understood the guidelines.

yes

A clear and concise description of the issue.

Hello,

Just tried to update my zwave LXC using bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/zwave-js-ui.sh)"

The script Show the ascii zwave JS UI and I have this error :
Loading... bash: -c: line 83: syntax error near unexpected token }'`

What settings are you currently utilizing?

  • Default Settings
  • Advanced Settings

Which Linux distribution are you employing?

Debian 11

If relevant, including screenshots or a code block can be helpful in clarifying the issue.

image

Please provide detailed steps to reproduce the issue.

No response

Originally created by @WorldOfGZ on GitHub (Nov 29, 2024). ### Please verify that you have read and understood the guidelines. yes ### A clear and concise description of the issue. Hello, Just tried to update my zwave LXC using `bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/zwave-js-ui.sh)"` The script Show the ascii zwave JS UI and I have this error : `Loading... bash: -c: line 83: syntax error near unexpected token `}'` ### What settings are you currently utilizing? - [X] Default Settings - [ ] Advanced Settings ### Which Linux distribution are you employing? Debian 11 ### If relevant, including screenshots or a code block can be helpful in clarifying the issue. ![image](https://github.com/user-attachments/assets/8a092c46-fdfe-4cd2-8557-de64eeacecb4) ### Please provide detailed steps to reproduce the issue. _No response_
Author
Owner

@MickLesk commented on GitHub (Nov 29, 2024):

There is no wrong syntax i think.

Can you try it manually?

RELEASE=$(curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
systemctl stop zwave-js-ui
rm -rf /opt/zwave-js-ui/*
cd /opt/zwave-js-ui
wget -q https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip
unzip -q zwave-js-ui-${RELEASE}-linux.zip
systemctl start zwave-js-ui
rm -rf /opt/zwave-js-ui/zwave-js-ui-${RELEASE}-linux.zip
rm -rf /opt/zwave-js-ui/store
@MickLesk commented on GitHub (Nov 29, 2024): There is no wrong syntax i think. Can you try it manually? ```bash RELEASE=$(curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') systemctl stop zwave-js-ui rm -rf /opt/zwave-js-ui/* cd /opt/zwave-js-ui wget -q https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip unzip -q zwave-js-ui-${RELEASE}-linux.zip systemctl start zwave-js-ui rm -rf /opt/zwave-js-ui/zwave-js-ui-${RELEASE}-linux.zip rm -rf /opt/zwave-js-ui/store
Author
Owner

@WorldOfGZ commented on GitHub (Nov 29, 2024):

@MickLesk
These lines code process an update without error in console.
I see this is updated in UI, but no devices appeare. probably something else wrong, maybe from my side

@WorldOfGZ commented on GitHub (Nov 29, 2024): @MickLesk These lines code process an update without error in console. I see this is updated in UI, but no devices appeare. probably something else wrong, maybe from my side
Author
Owner

@WorldOfGZ commented on GitHub (Nov 29, 2024):

I tried also 2 things now :

  • Create new LXC with the current script : same error at line 83
  • Update via the previous Tteck script : update OK, no problem of device
@WorldOfGZ commented on GitHub (Nov 29, 2024): I tried also 2 things now : - Create new LXC with the current script : same error at line 83 - Update via the previous Tteck script : update OK, no problem of device
Author
Owner

@MickLesk commented on GitHub (Nov 29, 2024):

i check it in a few minutes

@MickLesk commented on GitHub (Nov 29, 2024): i check it in a few minutes
Author
Owner

@WorldOfGZ commented on GitHub (Nov 29, 2024):

No emergency.
Restore helps a lot in this case :)

@WorldOfGZ commented on GitHub (Nov 29, 2024): No emergency. Restore helps a lot in this case :)
Author
Owner

@WorldOfGZ commented on GitHub (Nov 29, 2024):

About my remarks "I see this is updated in UI, but no devices appear"
Could it be linked to rm -rf /opt/zwave-js-ui/store ?
It seems there are all the settings of my nodes and server here

@WorldOfGZ commented on GitHub (Nov 29, 2024): About my remarks "I see this is updated in UI, but no devices appear" Could it be linked to `rm -rf /opt/zwave-js-ui/store` ? It seems there are all the settings of my nodes and server here
Author
Owner

@MickLesk commented on GitHub (Nov 29, 2024):

Can you try again?

clear console first / or exit console (cache)

@MickLesk commented on GitHub (Nov 29, 2024): Can you try again? clear console first / or exit console (cache)
Author
Owner

@WorldOfGZ commented on GitHub (Nov 29, 2024):

The update working,
image

But the update erase all the configuration (previous message). UI is like first configuration.
image
And for example /opt/zwave-js-ui/store/nodes.json is now empty

@WorldOfGZ commented on GitHub (Nov 29, 2024): The update working, ![image](https://github.com/user-attachments/assets/acfb8b6f-cee3-40dd-b0c7-18df4a3a6ce9) But the update erase all the configuration (previous message). UI is like first configuration. ![image](https://github.com/user-attachments/assets/733263dd-dde7-4128-b239-b5e7c1a6bbed) And for example `/opt/zwave-js-ui/store/nodes.json` is now empty
Author
Owner

@WorldOfGZ commented on GitHub (Nov 29, 2024):

Regarding previous message.

On Tteck script, it remove : rm -rf zwave-js-ui-${RELEASE}-linux.zip zwave-js-ui-linux store
The folder store is coming from the extraction of the zip file.

I don't know the reason, but on the current script this is like that :

rm -rf /opt/zwave-js-ui/zwave-js-ui-${RELEASE}-linux.zip
rm -rf /opt/zwave-js-ui/store

This is clearly not the same store which is deleted, and finally all the config is deleted after update

@WorldOfGZ commented on GitHub (Nov 29, 2024): Regarding previous message. On Tteck script, it remove : `rm -rf zwave-js-ui-${RELEASE}-linux.zip zwave-js-ui-linux store` The folder `store` is coming from the extraction of the zip file. I don't know the reason, but on the current script this is like that : ``` rm -rf /opt/zwave-js-ui/zwave-js-ui-${RELEASE}-linux.zip rm -rf /opt/zwave-js-ui/store ``` This is clearly not the same store which is deleted, and finally all the config is deleted after update
Author
Owner

@MickLesk commented on GitHub (Nov 29, 2024):

ah thats a breaking change. You have the old files now. Its migrated to .env file with new store paths.

You can do following:

  1. Do an Backup of your installation:
cp /opt/zwave-js-ui /opt/zwave-js-ui_bak
  1. Remove Old Folder & Create new folder
rm -rf /opt/zwave-js-ui
mkdir -p /opt/zwave-js-ui
mkdir -p /opt/zwave_store
  1. Move your old storage files to this path
cp /opt/zwave-js-ui/store/*  /opt/zwave_store
  1. Enter Main Folder:
cd /opt/zwave-js-ui
  1. Update Package:
RELEASE=$(curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
wget -q https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip
unzip -q zwave-js-ui-${RELEASE}-linux.zip
  1. Create .env File:
cat <<EOF >/opt/.env
ZWAVEJS_EXTERNAL_CONFIG=/opt/zwave_store/.config-db
STORE_DIR=/opt/zwave_store
EOF
  1. Update Service
nano /etc/systemd/system/zwave-js-ui.service

Check [Service] and add or change missing:

User=root
WorkingDirectory=/opt/zwave-js-ui
ExecStart=/opt/zwave-js-ui/zwave-js-ui-linux
EnvironmentFile=/opt/.env

Check if this works. Then i write an documentation about this

@MickLesk commented on GitHub (Nov 29, 2024): ah thats a breaking change. You have the old files now. Its migrated to .env file with new store paths. You can do following: 1. Do an Backup of your installation: ```bash cp /opt/zwave-js-ui /opt/zwave-js-ui_bak ``` 2. Remove Old Folder & Create new folder ```bash rm -rf /opt/zwave-js-ui mkdir -p /opt/zwave-js-ui mkdir -p /opt/zwave_store ``` 3. Move your old storage files to this path ```bash cp /opt/zwave-js-ui/store/* /opt/zwave_store ``` 4. Enter Main Folder: ```bash cd /opt/zwave-js-ui ``` 5. Update Package: ```bash RELEASE=$(curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') wget -q https://github.com/zwave-js/zwave-js-ui/releases/download/${RELEASE}/zwave-js-ui-${RELEASE}-linux.zip unzip -q zwave-js-ui-${RELEASE}-linux.zip ``` 6. Create .env File: ```bash cat <<EOF >/opt/.env ZWAVEJS_EXTERNAL_CONFIG=/opt/zwave_store/.config-db STORE_DIR=/opt/zwave_store EOF ``` 7. Update Service ```bash nano /etc/systemd/system/zwave-js-ui.service ``` Check [Service] and add or change missing: ```bash User=root WorkingDirectory=/opt/zwave-js-ui ExecStart=/opt/zwave-js-ui/zwave-js-ui-linux EnvironmentFile=/opt/.env ``` Check if this works. Then i write an documentation about this
Author
Owner

@WorldOfGZ commented on GitHub (Nov 29, 2024):

Thanks for your help, it seems to be OK now.

Just some additionnal information, if you made a documentation :
Point 1, it seems I need arg -r

cp -r /opt/zwave-js-ui /opt/zwave-js-ui_bak

Point 3, I think we need to start from bak directory :

cp -r /opt/zwave-js-ui_bak/store/*  /opt/zwave_store

Just to be sure, I made after an update with the script, and I have no error, and all my config
image

@WorldOfGZ commented on GitHub (Nov 29, 2024): Thanks for your help, it seems to be OK now. Just some additionnal information, if you made a documentation : Point 1, it seems I need arg `-r` ``` cp -r /opt/zwave-js-ui /opt/zwave-js-ui_bak ``` Point 3, I think we need to start from bak directory : ``` cp -r /opt/zwave-js-ui_bak/store/* /opt/zwave_store ``` Just to be sure, I made after an update with the script, and I have no error, and all my config ![image](https://github.com/user-attachments/assets/4867a05a-5d4e-427a-8756-9e5529bc61aa)
Author
Owner

@MickLesk commented on GitHub (Nov 29, 2024):

Fine, then i write tomorrow an documentation for the Migration process. Thx for Feedback 👍

@MickLesk commented on GitHub (Nov 29, 2024): Fine, then i write tomorrow an documentation for the Migration process. Thx for Feedback 👍
Author
Owner

@MickLesk commented on GitHub (Dec 2, 2024):

Added to discussions & close:
https://github.com/community-scripts/ProxmoxVE/discussions/635

@MickLesk commented on GitHub (Dec 2, 2024): Added to discussions & close: https://github.com/community-scripts/ProxmoxVE/discussions/635
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#113