Skip to content
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

Internal server error when exporting and importing questionnaire on same instance #4017

Open
yevon opened this issue Mar 6, 2024 · 5 comments

Comments

@yevon
Copy link

yevon commented Mar 6, 2024

What version of GlobaLeaks are you using?

4.14.8

What browser(s) are you seeing the problem on?

Chrome

What operating system(s) are you seeing the problem on?

Windows

Describe the issue

I'm trying to export and import a questionnarie between instances, but it just says Error! and nothing more, the http response is an internal server error. Exactly the same happens if I try to export and import in the same instance. I don't see anything special in the logs file located at:

/var/globaleaks/log/globaleaks.log

The http response just says:

{
"error_message": "InternalServerError [Unexpected]",
"error_code": 1,
"arguments": [
"Unexpected"
]
}

image

Are there some additional logs that I might check? Or can I pass the questionnaire file privately to review it? Thanks!

Proposed solution

No response

@evilaliv3
Copy link
Member

Thank you @yevon

This is a known limitation, you could not have duplicated questionnaires on the system because each question has unique IDs.
If you want you can duplicate the questionnaire and it will create a copy with new IDs.

@yevon
Copy link
Author

yevon commented Mar 6, 2024

Ok, just received an email with additional logs, it seems that unique constraint for the questionnaire is raising an exception:

sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: questionnaire.id
[SQL: INSERT INTO questionnaire (id, tid, name) VALUES (?, ?, ?)]
[parameters: ('58522e6e-a9bf-4ceb-87ad-febe988e5e51', 1, 'Parlament')] (Background on this error at: https://sqlalche.me/e/14/gkpj)

@yevon
Copy link
Author

yevon commented Mar 6, 2024

So if I just want to create new versions, I have to copy it, export the questionarie, import it to another instance, and make it the default for new reports. ok!

@yevon
Copy link
Author

yevon commented Mar 6, 2024

It would be nice that it just prompts you to import it as a new questionaire instead of raising an unexpected error, this way you could easily create new versions of the questionaire, and just change the context to the new version of the questionarie. Is this the correct approach to this?

@yevon
Copy link
Author

yevon commented Mar 6, 2024

I can think about to two solutions for this:

  1. Just raise a proper exception message with an advice when a duplicate import is detected, like "Importing the same questionnaire is not supported, please make a copy, export and import it to the new system".
  2. When the same questionaire is imported again, automatically create a new version of it, attaching a version number or a date or similar, and automatically change any context pointing to the new imported questionaire. The old questionare could be just archived, and only accessible via a filter or another menu option. Is a bit confusing that it allows you to modify it manually, but that the export import doesn't work.

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

No branches or pull requests

2 participants