-
Notifications
You must be signed in to change notification settings - Fork 495
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
500 server error when adding a dataset in dataverse where default template has no associated terms #8599
Comments
Looks like we may need to opt for some aspect of 1 or more complicated 2) as right now you also cannot edit the terms on these legacy templates (an error is thrown). |
So, to fix the issue for the one that was from the RT issue, I: Note that means the template now has a cc0 license, so this would need to be reviewed to make sure that is what is desired. If not, the dataverse admin can then change it through the UI. |
From some quick testing at QDR, I don't think you can create new templates that don't have a termsofuseandaccess so this might be a job for flyway. FWIW: I played with this commit to start - basically null check TermsOfUseAndAccess 'everywhere' it is being used to get the license (everywhere doesn't include in the xhtml files). Without a flyway, this would cause users of an old template to get custom terms instead of the default license though. |
Priority - the current work around is a manual fix. We are getting RT tickets on this issue so this is a production impacting issue. It will likely impact other dataverse implementations outside of harvard.edu |
sprint
|
This query can be used to fix individual templates. Eventually, will see if possible to handle problematic templates in bulk. Note this sets the fileaccessrequest in the template to false and the license_id to 1. We should verify those values (but we need to choose something for both, and that is the default if you just create a new template from the UI).
|
Foxing multiple in one query is a little tricky, but this query at least can be used multiple times (the last one was id specific) - this one will grab the first one without a terms, create a new terms, and links them. i.e. if you run a 2nd time, it will then grab the next one without terms...
|
Ah, actually the way to do it is in reverse - rather than first insert and then update (the problem being that the update then needs to take from a stack), you first update, then insert. This uses the "stacking" inherent in nextval. (I thought you might have to disable, then reenable the foreign key, but it seems to work without that, probably because it's all handled in the one query).
|
Sprint
|
|
Sprint:
|
This was reported by a user via RT:
They click Add Dataset on their dataverse and get a 500 error page.
The reason is that a null pointer is being thrown. After some investigation, it turns out that the dataset has a default template with no associated terms (termsofuseandaccess_id is null on the template) and that in turn causes the null pointer on line 163 of DatasetUtil:
License license = dsv.getTermsOfUseAndAccess().getLicense();
The workaround we suggested is to go and edit the template and associate terms (even if empty) to the template.
I did try to reproduce on demo with a new dataverse, but I wasn't able to create a template with no terms (I tried briefly) so it's possible that can't be done anymore and only affects some legacy templates (in prod, there were 89 such templates, 48 of which were set as a default template).
The fix could be one of:
• db update to create empty terms for any existing templates (and verify there is no way to create any such new ones)
• change line 163 to make sure dsv.getTermsOfUseAndAccess() is not null before calling getLicense()
The text was updated successfully, but these errors were encountered: