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

Add a migration to remove possible old values in organization table #2964

Closed
Macroz opened this issue Jun 15, 2022 · 1 comment · Fixed by #2965
Closed

Add a migration to remove possible old values in organization table #2964

Macroz opened this issue Jun 15, 2022 · 1 comment · Fixed by #2965
Assignees
Labels

Comments

@Macroz
Copy link
Collaborator

Macroz commented Jun 15, 2022

Add a migration to remove possible old values in organization table. Consider making the validation give a warning, but the code to ignore any unknown values. Optionally validate on save and/or disregard unknown values.

update organization set data = data - 'organization/modifier' - 'organization/last-modified';

Related to #2823

clojure.lang.ExceptionInfo: Value cannot be coerced to match schema: {:organization/modifier disallowed-key, :organization/last-modified disallowed-key}
	at schema.coerce$fn__3627$coercer_BANG___3632$fn__3633$fn__3634.invoke(coerce.clj:52)
	at clojure.core$mapv$fn__8535.invoke(core.clj:6979)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6885)
	at clojure.core$mapv.invokeStatic(core.clj:6970)
	at clojure.core$mapv.invoke(core.clj:6970)
	at rems.db.organizations$get_organizations_raw.invokeStatic(organizations.clj:42)
	at rems.db.organizations$get_organizations_raw.invoke(organizations.clj:39)
	at rems.db.organizations$get_all_organization_roles.invokeStatic(organizations.clj:83)
	at rems.db.organizations$get_all_organization_roles.invoke(organizations.clj:81)
	at rems.middleware$wrap_context$fn__35620.invoke(middleware.clj:73)
	at rems.middleware$wrap_user$fn__35615$fn__35616.invoke(middleware.clj:65)
	at rems.logging$with_mdc_STAR_.invokeStatic(logging.clj:21)
	at rems.logging$with_mdc_STAR_.invoke(logging.clj:9)
	at rems.middleware$wrap_user$fn__35615.invoke(middleware.clj:64)
	at ring.middleware.anti_forgery$wrap_anti_forgery$fn__670.invoke(anti_forgery.clj:94)
	at rems.middleware$wrap_api_key_or_csrf_token$fn__35612.invoke(middleware.clj:57)
	at buddy.auth.middleware$wrap_authentication$fn__31678.invoke(middleware.clj:60)
	at rems.auth.auth$wrap_uses_valid_api_key$fn__32220.invoke(auth.clj:40)```
@Macroz Macroz added the BUG label Jun 15, 2022
@Macroz
Copy link
Collaborator Author

Macroz commented Jun 15, 2022

In the migration we dropped the columns, but some of the values have snuck up in the JSON blobs. Now that there exists a validation for the data, the extra values prevent normal use.

@Macroz Macroz self-assigned this Jun 16, 2022
@meericsc meericsc moved this to Accepted in REMS Task Board May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant