seek4science / seek

For finding, sharing and exchanging Data, Models, Simulations and Processes in Science.
http://www.seek4science.org
BSD 3-Clause "New" or "Revised" License
77 stars 52 forks source link

Error raised when updating a Sample Type #2068

Closed kdp-cloud closed 1 week ago

kdp-cloud commented 1 week ago

When a Sample Type is updated, the following error is raised.

  unknown attribute 'make_local_copy' for ContentBlob.

          raise UnknownAttributeError.new(self, k.to_s)
          ^^^^^
  /seek/vendor/bundle/ruby/3.1.0/gems/activemodel-6.1.7.10/lib/active_model/attribute_assignment.rb:51:in `_assign_attribute'

This is probably an indication that the 'Template' is not being created, resulting in this error message on the webpage:

image

Note: This was not noticed during the development. Due to development mode?

stuzart commented 1 week ago

sounds like the migrations haven't been run properly, and is missing this one - https://github.com/seek4science/seek/blob/main/db/migrate/20240823123223_add_make_local_copy_to_content_blob.rb

are you able to reproduce this on the test server ?

kdp-cloud commented 1 week ago

You're right. I was missing migrations apparently, which explains why I didn't have the error while developing...

... migrating database ...
== 20240823123223 AddMakeLocalCopyToContentBlob: migrating ====================
-- add_column(:content_blobs, :make_local_copy, :boolean, {:default=>false})
   -> 0.0740s
== 20240823123223 AddMakeLocalCopyToContentBlob: migrated (0.0742s) ===========

== 20241015093333 DropObservationUnitProjects: migrating ======================
-- drop_table(:observation_units_projects, {:id=>false})
   -> 0.0947s
== 20241015093333 DropObservationUnitProjects: migrated (0.0948s) =============

I don't get the error anymore so I'll close the issue.