Cockpit update_script / cockpit-file-sharing #724

Closed
opened 2026-02-04 21:07:28 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @stt on GitHub (Apr 1, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Cockpit

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/cockpit.sh)"

📝 Provide a clear and concise description of the issue.

Running community-script within cockpit LXC (ie. as update_script) to install optional components fails.

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

🔄 Steps to reproduce the issue.

In cockpit LXC run the script and try to install cockpit-file-sharing.

Paste the full error output (if available).

⠹ Installing dependencies (patience)Processing triggers for libc-bin (2.36-9+deb12u10) ...
  ✔️   Installed dependencies
⠼ Installing Cockpit file sharingcurl: (3) URL using bad/illegal format or missing URL
curl: (22) The requested URL returned error: 400

[ERROR] in line 54: exit code 0: while executing command curl -fsSL "$(curl -fsSL https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)" -o $(basename "$(curl -fsSL https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)")

🖼️ Additional context (optional).

Running the curl grep from the error manually makes the issue clear, there's multiple .debs in the release:

root@cockpit:~# curl -fsSL https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4
https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.2.9-8/cockpit-file-sharing_4.2.9-7focal_all.deb
https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.2.9-8/cockpit-file-sharing_4.2.9-8focal_all.deb

Trivial fix would be to add | tail -n1 but this script has broken before (#157) maybe it'd be useful to add a shared utility function for "fetching latest github release file by file extension" that all the scripts could use and might stay more robust/fault tolerant through being centrally maintained?

Also while not cause of the issue I don't think it should run the same curl twice simply to fetch the filename
Doing URL=$(curl ..) and then FILENAME=$(basename "$URL") would be better?

Originally created by @stt on GitHub (Apr 1, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Cockpit ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/cockpit.sh)" ### 📝 Provide a clear and concise description of the issue. Running community-script within cockpit LXC (ie. as update_script) to install optional components fails. ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 🔄 Steps to reproduce the issue. In cockpit LXC run the script and try to install cockpit-file-sharing. ### ❌ Paste the full error output (if available). ``` ⠹ Installing dependencies (patience)Processing triggers for libc-bin (2.36-9+deb12u10) ... ✔️ Installed dependencies ⠼ Installing Cockpit file sharingcurl: (3) URL using bad/illegal format or missing URL curl: (22) The requested URL returned error: 400 [ERROR] in line 54: exit code 0: while executing command curl -fsSL "$(curl -fsSL https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)" -o $(basename "$(curl -fsSL https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)") ``` ### 🖼️ Additional context (optional). Running the curl grep from the error manually makes the issue clear, there's multiple .debs in the release: ``` root@cockpit:~# curl -fsSL https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4 https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.2.9-8/cockpit-file-sharing_4.2.9-7focal_all.deb https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.2.9-8/cockpit-file-sharing_4.2.9-8focal_all.deb ``` Trivial fix would be to add `| tail -n1` but this script has broken before (#157) maybe it'd be useful to add a shared utility function for "fetching latest github release file by file extension" that all the scripts could use and might stay more robust/fault tolerant through being centrally maintained? Also while not cause of the issue I don't think it should run the same curl twice simply to fetch the filename Doing URL=$(curl ..) and then `FILENAME=$(basename "$URL")` would be better?
OVERLORD added the bugrefactor labels 2026-02-04 21:07:28 +03:00
Author
Owner

@MickLesk commented on GitHub (Apr 1, 2025):

this script need an full refactor.

@MickLesk commented on GitHub (Apr 1, 2025): this script need an full refactor.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#724