Skip to content

Management server hangs when js.interpretation.enabled=true #12523

Description

@RosiKyu

problem

Enabling the global setting js.interpretation.enabled=true causes the CloudStack management server to hang during startup at the module loading phase. This prevents using the secondary storage selector feature (createSecondaryStorageSelector, updateSecondaryStorageSelector APIs).

versions

  • 4.20 branch (4.20.3.0-SNAPSHOT) - AFFECTED - needs fix before 4.20.3.0 release
  • 4.20.2.0 (released) - Not affected (commit not present, setting does not exist, APIs work unconditionally)

Introduced by commit 03a4b9f ("server,utils: improve js interpretation functionality") merged on Oct 16, 2025 into the 4.20 branch.

The commit:

  1. Added js.interpretation.enabled as a hidden ConfigKey (default: false)
  2. Made CreateSecondaryStorageSelectorCmd and UpdateSecondaryStorageSelectorCmd conditional on this setting
  3. Made significant changes to JsInterpreter.java (security hardening, daemon workers, etc.)

When the setting is enabled, something in the initialization causes the MS server to hang.

The steps to reproduce the bug

  1. Deploy CloudStack 4.20.3.0
  2. Verify server is running:
   curl -s "http://localhost:8080/client/api?command=listZones" | head -5
  1. Enable the js.interpretation.enabled setting:
   mysql -u root -p cloud -e "UPDATE configuration SET value='true' WHERE name='js.interpretation.enabled';"
  1. Restart management server:
   systemctl restart cloudstack-management
  1. Wait 3+ minutes and check server status:
   curl -s "http://localhost:8080/client/api?command=listZones" | head -5

Expected Result

Server starts successfully and createSecondaryStorageSelector API is available.

Actual Result

Server returns 503 Service Unavailable. Log shows server stuck at module loading phase:

2026-01-26 19:53:01,937 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:[]) (logid:) Trying to obtain module [redfish] context.
2026-01-26 19:53:01,937 WARN  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:[]) (logid:) Application context not found for module definition [redfish]

Log timestamp remains static while current time progresses - server is hung.

Evidence

4.20 branch build (shapeblue18197) - Bug present:

[root@ref-trl-10730-k-Mol9-rositsa-kyuchukova-mgmt1 ~]# rpm -qa | grep cloudstack
cloudstack-common-4.20.3.0-shapeblue18197.noarch
cloudstack-management-4.20.3.0-shapeblue18197.noarch

[root@ref-trl-10730-k-Mol9-rositsa-kyuchukova-mgmt1 ~]# mysql -u root -p cloud -e "UPDATE configuration SET value='true' WHERE name='js.interpretation.enabled';"
[root@ref-trl-10730-k-Mol9-rositsa-kyuchukova-mgmt1 ~]# systemctl restart cloudstack-management
[root@ref-trl-10730-k-Mol9-rositsa-kyuchukova-mgmt1 ~]# sleep 180
[root@ref-trl-10730-k-Mol9-rositsa-kyuchukova-mgmt1 ~]# curl -s "http://localhost:8080/client/api?command=listZones" | head -5
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 503 Service Unavailable</title>
</head>

4.20.2.0 released version (shapeblue17631) - Works correctly:

[root@ref-trl-10714-k-Mol9-rositsa-kyuchukova-mgmt1 ~]# rpm -qa | grep cloudstack
cloudstack-common-4.20.2.0-shapeblue17631.noarch
cloudstack-management-4.20.2.0-shapeblue17631.noarch

mysql> SELECT name, value FROM configuration WHERE name LIKE '%interpret%';
Empty set (0.00 sec)

[root@ref-trl-10714-k-Mol9-rositsa-kyuchukova-mgmt1 ~]# cmk list apis 2>/dev/null | grep -i "name.*selector"
      "name": "createSecondaryStorageSelector",
      "name": "updateSecondaryStorageSelector",
      "name": "listSecondaryStorageSelectors",
      "name": "removeSecondaryStorageSelector",

Impact

Related

What to do about it?

No response

Activity

  1. added theissue type on Jan 26, 2026
  2. RosiKyu commented on Jan 26, 2026

    @RosiKyu
    CollaboratorAuthor

    Update

    The root cause has been identified. The js.interpretation.enabled setting requires an encrypted value in the database, not plain text.

    Workaround:

    1. Get encryption key: cat /etc/cloudstack/management/key
    2. Encrypt the value: java -classpath /usr/share/cloudstack-common/lib/cloudstack-utils.jar com.cloud.utils.crypt.EncryptionCLI -p <key> -i true
    3. Update with encrypted value: UPDATE configuration SET value='<encrypted>' WHERE name='js.interpretation.enabled';

    Remaining issues:

    1. Server hangs silently instead of showing a clear error when decryption fails
    2. No documentation that this hidden setting requires encryption
    3. Consider adding validation/error handling for encrypted config values

    Could be closed as user error, but suggesting improvement to error handling.

  3. added this to the 4.20.3 milestone on Jan 27, 2026
  4. DaanHoogland commented on Jan 27, 2026

    @DaanHoogland
    Contributor

    @winterhazel , any thoughts?

  5. winterhazel commented on Jan 28, 2026

    @winterhazel
    Member

    @winterhazel , any thoughts?

    @DaanHoogland regarding the startup failure, it is the behavior I find correct for this situation. There should also be a clear message in the logs informing that there was an issue while decrypting this configuration's value, so that operators know what to look into.

    I have some thoughts about js.interpretation.enabled though. I do not have access to the discussion regarding the CVE that prompted the introduction of this setting to know why it was handled that way. However, I think that it should not have been made a hidden setting with an encrypted value, and should be enabled by default. The vulnerability was fixed as far as I am aware; also, the APIs that allow configuring scripts (host, Quota tariff, and secondary storage selector configuration) should only be accessible to people with access to the infrastructure. Hence, if a new vulnerability with the interpreter gets discovered and exploited, that is not an issue with the platform, but internal permission granting issues. Other features that come enabled by default may have vulnerabilities that we are not aware of yet, but that's not a reason for we to disable them by default. Having it as a hidden encrypted setting just makes it unnecessarily difficult for operators to use the features.

  6. DaanHoogland commented on Jan 28, 2026

    @DaanHoogland
    Contributor

    3. Consider adding validation/error handling for encrypted config values

    in short @winterhazel , you would agree with ^ this? Should be a simple PR. I’ll put it on my list

  7. winterhazel commented on Feb 2, 2026

    @winterhazel
    Member

    @DaanHoogland yes, I agree with @RosiKyu's suggestions in 1 and 3.

    2 not so much as I think that it should not be hidden at all.

  8. shwstppr commented on Feb 2, 2026

    @shwstppr
    Contributor

    @winterhazel @RosiKyu cc @DaanHoogland The idea behind keeping some settings hidden is to not allow root admin accounts to change them. Only a privileged user having access to DB would be able to change them.
    Incidentally all hidden settings are encrypted currently which can be documented.

  9. winterhazel commented on Feb 4, 2026

    @winterhazel
    Member

    @winterhazel @RosiKyu cc @DaanHoogland The idea behind keeping some settings hidden is to not allow root admin accounts to change them. Only a privileged user having access to DB would be able to change them. Incidentally all hidden settings are encrypted currently which can be documented.

    @shwstppr ok, but my point is that js.interpretation.enabled should not be kept hidden. Is there a reason for restricting root admin accounts, which can already do anything they want with all resources in the environment as long as they receive API permission, from enabling a feature that only they will be able to use?

  10. shwstppr commented on Feb 5, 2026

    @shwstppr
    Contributor

    @winterhazel while in most cases ROOT admin will have access to the system as well (underlying server), but there can be cases when ROOT admin is just the CloudStack admin. In those cases, a non-hidden config can be changed by this CloudStack admin and the system can be under security risk as highlighted by the CVE for which this setting was introduced. There could be better means to alter such configs, but for no,w ACS provides only the hidden configs

  11. winterhazel commented on Feb 5, 2026

    @winterhazel
    Member

    @shwstppr as I commented in #12523 (comment): the known vulnerabilities pertaining the JS were patched, weren't they? Other features that come enabled by default almost certainly have vulnerabilities that we are not aware of yet, but we cannot put them behind a hidden setting due to a hypothetical security issue. If we were consistent with how the JS interpretation was handled, then we would have to also disable by default and place behind a hidden setting features like direct download, volume/template upload and register, which had CVEs in the past, and all other functionalities that uses administrator/user input in a shell/python script.

    The extraconfig feature could also be used to abuse the environment. Following your logic, root admins should not be able to see/change this configuration, yet the configurations related to this feature are not hidden.

  12. shwstppr commented on Feb 5, 2026

    @shwstppr
    Contributor

    @winterhazel it was not my logic alone. It was a PMC decision. I was just explaining the case. If you're not happy with it please raise with it.
    Also, you may create a change PR to make it a regular config and get it merged ✌️

  13. GutoVeronezi commented on Feb 5, 2026

    @GutoVeronezi
    Contributor

    @shwstppr @winterhazel

    Reviewing the private discussion, I see that the fix started with the config as hidden, and it was mentioned that we could discuss it, but we never had the actual discussion about whether it should or should not be hidden (perhaps because of the urgency to release the fixes or lack of time/attention; water under the bridge). Now that we no longer have such urgency, it is a good opportunity to discuss whether it makes sense to change it or keep it as it is.

    @winterhazel, if you will, create a PR with your proposal so we can move forward with the discussion.

  14. 3 remaining items

  15. DaanHoogland commented on Mar 3, 2026

    @DaanHoogland
    Contributor

    @RosiKyu I read your comments and then the discussions following. What in you opinion is to be done (in order of priority)?

    @winterhazel same question to you..

  16. winterhazel commented on Apr 10, 2026

    @winterhazel
    Member

    @DaanHoogland I think that the startup failure when an encrypted setting has a decrypted value in the database is the correct behavior. This indicates to operators that there is something wrong that they need to check. We just need to improve the logging when this failure happens. Maybe something like:

    We expect the value of setting '<name>' to be encrypted in the database with the Management Server's key, but we were unable to decrypt it using this key. This issue may happen when the value was manually changed in the database to a plain decrypted value. For reference on how to change the value of encrypted settings through the database, see <URL to the docuementation>.'

  17. moved this from on Hold to Dev In Progress in Apache CloudStack BugFest - Issueson May 19, 2026
  18. moved this from Dev In Progress to ready for Review in Apache CloudStack BugFest - Issueson May 21, 2026
  19. github-actions commented on Jul 2, 2026

    @github-actions

    🎯 Triage report

    When js.interpretation.enabled is set to a plain-text true value in the database (rather than the required encrypted form), the management server hangs silently during startup with no actionable error message. The root cause is user configuration error — the setting is a hidden encrypted key that must be set via EncryptionCLI — but the actual bug is that the server hangs indefinitely instead of failing fast with a clear diagnostic. Community consensus is to improve error handling for misconfigured encrypted settings.

    📊 Assessment

    Dimension Value Reasoning
    Type type:bug Server hangs silently rather than emitting a clear error for misconfigured encrypted settings
    Component component:management-server Startup/config loading phase
    Severity Severity:Minor Setting is not commonly used; workaround is documented in issue comments
    Labels type:bug, component:management-server, Severity:Minor See above
    Coding agent Suitable Narrow, well-scoped fix: emit a clear error message when config decryption fails at startup instead of hanging
    💡 Notes and suggestions

    Workaround (documented in comments):

    1. Get encryption key: cat /etc/cloudstack/management/key
    2. Encrypt the value: java -classpath /usr/share/cloudstack-common/lib/cloudstack-utils.jar com.cloud.utils.crypt.EncryptionCLI -p <key> -i true
    3. Update DB with the encrypted value.

    Fix suggestion: In the configuration loading/decryption code, catch EncryptionException / decryption failure and emit a log message such as:

    "Failed to decrypt value for setting 'js.interpretation.enabled'. This setting requires an encrypted value set via EncryptionCLI. See documentation at (URL)."

    Then fail fast with a clear startup error rather than hanging.

    Related: PR #12605 proposes making js.interpretation.enabled a regular (non-hidden) configuration.

    Generated by Daily Issue Triage · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@d7c1dc4b72b00607a67caaffdcc216cb64379cf9
    
  20. scottsignal commented on Sep 9, 2026

    @scottsignal

    This makes it really painful to enable js.interpretation.enabled. There are legitimate reasons to use this flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions