Skip to content

Unable to save question when sandbox parameters exceed 255 characters #252

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

Open
voegii opened this issue Apr 8, 2025 · 0 comments
Open

Comments

@voegii
Copy link

voegii commented Apr 8, 2025

When the length of the sandbox parameters (sandboxparam) exceeds 255 characters, the question cannot be saved and an error message "Error writing to database" is shown. This issue commonly occurs with Java-type questions due to their longer file names or parameter lengths.

Expected Behavior:
Questions should be saved successfully regardless of the length of the sandbox parameters.

Actual Behavior:
An error "Error writing to database" appears when attempting to save questions with sandbox parameters longer than 255 characters.

Steps to Reproduce:

  • Create a question of type java_class.
  • In "support files" upload some jar files
  • Enable "Customise"
  • Under "Advanced customisation" set sandbox parameters with a length greater than 255 characters. E.g. {"compileargs": ["-cp", "mylibrary-sample-3.12.3.jar:mylibrary-core-3.12.3.jar:mylibrary-databind-3.12.3.jar", "-J-Xss64m", "-J-Xmx4g"], "interpreterargs": ["-cp", ".:mylibrary-sample-3.12.3.jar:mylibrary-core-3.12.3.jar:mylibrary-databind-3.12.3.jar", "-Xss16m", "-Xmx500m"]}
  • Attempt to save the question.
  • Observe the error message.

Suggested Solution:
Increase the database field size for sandboxparam to accommodate longer sandbox parameter strings.

Workaround:
Shorten the file names of the jar files and in the sandbox parameters to stay within the current 255-character limit.

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

1 participant