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

Validation output oddness #136

Open
aschroed opened this issue Jun 25, 2019 · 1 comment
Open

Validation output oddness #136

aschroed opened this issue Jun 25, 2019 · 1 comment

Comments

@aschroed
Copy link
Member

Using import_data as a non-admin user but submitter for Belmont lab In some cases an error regarding no access to a released item is generated and reported:
ERROR filereference belmont-lab:Drosophila48E12_bio-spike-in.fasta: Access was denied to this resource. - only a single row filled in for this sheet

In another case where an alias to released Biosample was used for what was meant to be a new Item there was no Error generated - multiple rows in this case:
BIOSAMPLE(8) : 0 posted / 7 not posted 0 patched / 1 not patched, 0 errors

This seems inconsistent.

Additional info - if only the Biosample sheet is loaded then the error is generated.

Other validation errors generated for other items:
before the Biosample:
ERROR image Field 'Schema: attachment.type': 'application/pdf' is not one of ['image/png', 'image/jpeg', 'image/gif']
ERROR image Field 'Schema: attachment.type': 'application/pdf' is not one of ['image/png', 'image/jpeg', 'image/gif']

and after Biosample:
ERROR: '/Experiment/belmont-lab:no1-control-son-ab2-tsa-seq-v2-hct116-cond2-lz-201711' is NOT FOUND - THE REQUIRED TYPE IS Experiment
ERROR: '/Experiment/belmont-lab:no1-control-son-ab2-tsa-seq-v2-hct116-cond2-condE-lz-201803' is NOT FOUND - THE REQUIRED TYPE IS Experiment
ERROR: '/Experiment/belmont-lab:no1-control-son-ab2-tsa-seq-v2-hct116-cond2-condE-lz-201803' is NOT FOUND - THE REQUIRED TYPE IS Experiment

@KorayKirli
Copy link
Member

KorayKirli commented Jul 1, 2019

We have this error because validation happens in sequence, if you hit one validation error, the patch/post body will not go through the other validations.

When you do a test post/patch with submit4dn, we keep the linkTos to new items (aliases) in the request body, and this results in 'missing linkto item' error. In submit4dn we ignore this specific error, if the missing alias is in the excel. So even if you don't have permission to modify the referenced item (in a patch), you won't see the validation error, because the response only has the 'missing item' error, which is ignored.

We can tackle this problem couple of ways

  1. take out the alias linkTo's. Will be a problem if field is required (Biosource in Biosample)
  2. hit all validations with fourfront (carl said this is not trivial)
  3. order validations in fourfront from most important to less, so the error we see is the most sensible one

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

2 participants