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

FrozenError - can't modify frozen properties #947

Open
bbpennel opened this issue Apr 1, 2024 · 1 comment
Open

FrozenError - can't modify frozen properties #947

bbpennel opened this issue Apr 1, 2024 · 1 comment

Comments

@bbpennel
Copy link
Contributor

bbpennel commented Apr 1, 2024

We have been frequently getting errors like the following when we are performing CSV imports with bulkrax 6.0.1 and hyrax 4. It appears to be related to setting properties on the FileSet object typically:

2024-02-14 08:38:00 -0500 - ERROR: [ActiveJob] [AttachFilesToWorkJob] [ff4797c5-edef-497d-b3c0-0cda6048cad8] Error performing AttachFilesToWorkJob (Job ID: ff4797c5-edef-497d-b3c0-0cda6048cad8) from Sidekiq(default) in 7736.34ms: FrozenError (can't modify frozen RDF::URI: #<RDF::URI:0xaab40 URI:http://schema.org/>):
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/model/uri.rb:723:in `block in freeze'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/model/uri.rb:720:in `synchronize'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/model/uri.rb:720:in `freeze'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/model/uri.rb:163:in `intern'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:187:in `process_iri'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:294:in `block (2 levels) in read_directive'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:559:in `prod'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:287:in `block in read_directive'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:559:in `prod'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:265:in `read_directive'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:249:in `block in read_statement'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:559:in `prod'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:245:in `read_statement'
/ruby/2.7.0/gems/rdf-turtle-3.2.1/lib/rdf/turtle/reader.rb:136:in `each_statement'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/model/graph.rb:322:in `block in insert_statements'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/enumerable.rb:183:in `each'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/enumerable.rb:183:in `each'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/enumerable.rb:183:in `each_statement'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/writable.rb:129:in `insert_statements'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/writable.rb:64:in `block in insert'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/util/coercions.rb:38:in `block in coerce_statements'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/util/coercions.rb:35:in `map'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/util/coercions.rb:35:in `coerce_statements'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/writable.rb:64:in `insert'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/mutable.rb:96:in `insert'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/model/graph.rb:328:in `insert_statements'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/writable.rb:86:in `insert_reader'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/writable.rb:29:in `<<'
/ruby/2.7.0/gems/rdf-3.2.11/lib/rdf/mixin/mutable.rb:72:in `<<'
/ruby/2.7.0/gems/ldp-1.0.3/lib/ldp/response.rb:108:in `graph'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/ldp_resource.rb:27:in `response_as_graph'
/ruby/2.7.0/gems/ldp-1.0.3/lib/ldp/resource/rdf_source.rb:58:in `response_graph'
/ruby/2.7.0/gems/ldp-1.0.3/lib/ldp/resource/rdf_source.rb:33:in `graph'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/fedora_attributes.rb:46:in `resource'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/fedora_attributes.rb:13:in `get_values'
/ruby/2.7.0/gems/active-triples-1.2.0/lib/active_triples/property_builder.rb:70:in `create_date'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/fedora_attributes.rb:20:in `create_date'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/indexing_service.rb:50:in `c_time'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/indexing_service.rb:35:in `generate_solr_document'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/services/hyrax/indexes_thumbnails.rb:15:in `generate_solr_document'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/indexers/hyrax/file_set_indexer.rb:9:in `generate_solr_document'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/indexing.rb:42:in `to_solr'
/ruby/2.7.0/gems/hydra-access-controls-12.1.0/app/models/concerns/hydra/access_controls/permissions.rb:29:in `to_solr'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/models/concerns/hyrax/human_readable_type.rb:17:in `to_solr'
/ruby/2.7.0/gems/hydra-access-controls-12.1.0/app/models/concerns/hydra/access_controls/embargoable.rb:37:in `to_solr'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/indexing.rb:52:in `update_index'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/callbacks.rb:235:in `block in update_index'
/ruby/2.7.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:98:in `run_callbacks'
/ruby/2.7.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:824:in `_run_update_index_callbacks'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/callbacks.rb:235:in `update_index'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/indexing.rb:82:in `_update_record'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/callbacks.rb:249:in `block in _update_record'
/ruby/2.7.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:106:in `run_callbacks'
/ruby/2.7.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:824:in `_run_update_callbacks'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/callbacks.rb:249:in `_update_record'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/persistence.rb:179:in `create_or_update'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/callbacks.rb:241:in `block in create_or_update'
/ruby/2.7.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:106:in `run_callbacks'
/ruby/2.7.0/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:824:in `_run_save_callbacks'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/callbacks.rb:241:in `create_or_update'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/persistence.rb:44:in `save!'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/validations.rb:56:in `save!'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/builder/orders.rb:50:in `save!'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/indirectly_contains_association.rb:16:in `insert_record'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/collection_association.rb:163:in `block (2 levels) in concat_records'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/collection_association.rb:262:in `add_to_target'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/collection_association.rb:162:in `block in concat_records'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/collection_association.rb:160:in `each'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/collection_association.rb:160:in `concat_records'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/indirectly_contains_association.rb:10:in `concat'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/associations/orders_association.rb:55:in `append_target'
/ruby/2.7.0/gems/active-fedora-14.0.1/lib/active_fedora/orders/target_proxy.rb:11:in `<<'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/actors/hyrax/actors/file_set_actor.rb:75:in `block in attach_to_work'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/services/hyrax/lock_manager.rb:25:in `block (2 levels) in lock'
/ruby/2.7.0/gems/redlock-1.3.2/lib/redlock/client.rb:81:in `lock'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/services/hyrax/lock_manager.rb:23:in `block in lock'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/services/hyrax/lock_manager.rb:22:in `then'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/services/hyrax/lock_manager.rb:22:in `lock'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/services/hyrax/lockable.rb:7:in `acquire_lock_for'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/actors/hyrax/actors/file_set_actor.rb:71:in `attach_to_work'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/jobs/attach_files_to_work_job.rb:40:in `attach_work'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/jobs/attach_files_to_work_job.rb:28:in `block in perform_af'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/jobs/attach_files_to_work_job.rb:26:in `each'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/jobs/attach_files_to_work_job.rb:26:in `perform_af'
/ruby/2.7.0/bundler/gems/hyrax-6127e4878a83/app/jobs/attach_files_to_work_job.rb:11:in `perform'

It's not consistent what property it is attempting to modify:

ERROR: [ActiveJob] [AttachFilesToWorkJob] [ff4797c5-edef-497d-b3c0-0cda6048cad8] Error performing AttachFilesToWorkJob (Job ID: ff4797c5-edef-497d-b3c0-0cda6048cad8) from Sidekiq(default) in 7736.34ms: FrozenError (can't modify frozen RDF::URI: #<RDF::URI:0xaab40 URI:http://schema.org/>):

ERROR: [ActiveJob] [AttachFilesToWorkJob] [6669f3d1-049f-4ba6-9c43-4af03f5be12e] Error performing AttachFilesToWorkJob (Job ID: 6669f3d1-049f-4ba6-9c43-4af03f5be12e) from Sidekiq(default) in 14844.6ms: FrozenError (can't modify frozen RDF::URI: #<RDF::URI:0xeebb0 URI:http://projecthydra.org/ns/fits/>):

ERROR: [ActiveJob] [AttachFilesToWorkJob] [266e990c-afcd-4df4-bfe4-82bef9411b77] Error performing AttachFilesToWorkJob (Job ID: 266e990c-afcd-4df4-bfe4-82bef9411b77) from Sidekiq(default) in 13963.87ms: FrozenError (can't modify frozen RDF::URI: #<RDF::URI:0x10d268 URI:http://projecthydra.org/ns/odf/>):

ERROR: [ActiveJob] [AttachFilesToWorkJob] [e5989ed5-c7e8-4913-8ea5-4013cb15ff5c] Error performing AttachFilesToWorkJob (Job ID: e5989ed5-c7e8-4913-8ea5-4013cb15ff5c) from Sidekiq(default) in 18993.27ms: FrozenError (can't modify frozen RDF::URI: #<RDF::URI:0x12460c URI:http://projecthydra.org/ns/mix/>):

As far as i can tell it doesn't cause the import to fail, and the files still get attached/ingested, we only had one case where the files failed to attach and I'm not sure if it was related or not. I see similar issues with IngestJob and CreateDerivativesJob. The errors do not happen directly in bulkrax, so it's possible it not directly related to bulkrax, but the errors only seem to happen with objects created with bulkrax.

@bbpennel
Copy link
Contributor Author

bbpennel commented Jun 24, 2024

We had this happen again (it happens reliably when we do large bulkrax imports), but in this case it caused an incomplete fedora object to be created. The work and fileset were created, but the fileset did not end up in the ListSource object in fedora (for tracking member order), which caused the show work page to throw a 500 because one of the filesets in the work was being given a Work presenter instead of a Fileset presenter.

I'm guessing this may be a Hyrax/activefedora issue rather than bulkrax specifically, but it only occurs for us when using bulkrax since that is how we ingest sets of hundreds of works at once. So I may post the issue over there to see if they have thoughts.

In this case, the error occurs deep in the stack originating from this line, which explains how the FileSet failed to add to the list of ordered members. In the cases where it didn't cause noticeable problems it failed on other lines, like line 80 in the same file.

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

1 participant