Bug Report – HTTPS Page Unreachable in Control Panel (502 Bad Gateway)
Hi,
I came across an issue with the Control Panel's HTTPS page. A few months ago, I configured HTTPS and everything worked correctly. However, when I recently attempted to update the SSL certificates, I was no longer able to access the HTTPS page — it consistently returned a 502 Bad Gateway error. All other pages remained accessible and functional.
While investigating, I found the following error in the logs:
2025-07-21 07:04:04 - error: executeOneClickinstallScript stderr{"date":"Mon Jul 21 2025 07:04:04 GMT+0000 (Coordinated Universal Time)","error":{"code":"ERR_UNHANDLED_REJECTION"},"exception":true,"level":"error","message":"uncaughtException: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason \"/var/www/onlyoffice/controlpanel/www/executables/tools/get.sh: line 46: [: too many arguments\n\".\nUnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason \"/var/www/onlyoffice/controlpanel/www/executables/tools/get.sh: line 46: [: too many arguments\n\".","os":{"loadavg":[0.2,0.4,0.3],"uptime":19240253.89},"process":{"argv":["/usr/bin/node","/var/www/onlyoffice/controlpanel/www/server.js"],"cwd":"/var/www/onlyoffice/controlpanel/www","execPath":"/usr/bin/node","gid":0,"memoryUsage":{"arrayBuffers":16974518,"external":18294287,"heapTotal":37134336,"heapUsed":34227256,"rss":92614656},"pid":1040,"uid":0,"version":"v16.20.2"},"stack":"UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason \"/var/www/onlyoffice/controlpanel/www/executables/tools/get.sh: line 46: [: too many arguments\n\".","trace":[]} 2025-07-21 07:04:04 - error: uncaughtException: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "/var/www/onlyoffice/controlpanel/www/executables/tools/get.sh: line 46: [: too many arguments ". UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "/var/www/onlyoffice/controlpanel/www/executables/tools/get.sh: line 46: [: too many arguments ".
The root cause appears to be in this script: /var/www/onlyoffice/controlpanel/www/executables/tools/get.sh (line 46), where the condition lacks proper quoting, causing a [: too many arguments error. I corrected the issue by updating line 46 in the script to safely quote the command substitution:
if [ -n "$(docker exec $COMMUNITY_CONTAINER_NAME ls $FROM 2>/dev/null)" ]; then
docker cp ${COMMUNITY_CONTAINER_NAME}:${FROM} ${TO}
exit 0;
fi
Would this be the recommended fix? And if so, would it be possible to update this in your codebase? Thank you