Import error: "Validation failed: Notes is invalid"
A customer is getting the following error when attempting to import a repo from a GitLab export:
"message": "Failed to set merge_requests: Validation failed: Notes is invalid",
"caller": "/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/import_export/project_tree_restorer.rb:37:in `rescue in restore'"
They are exporting from 12.2.4, importing to 12.2.1. There was a previous similar issue that was supposedly fixed in 12.2: https://gitlab.com/gitlab-org/gitlab-ce/issues/63955
But we find the following in sentry, still happening as of 9/9:
https://sentry.gitlab.net/gitlab/gitlabcom/issues/934339/events/19721042/
from project.rb:1903:in `block in append_or_update_attribute'
from project.rb:1902:in `each'
from project.rb:1902:in `append_or_update_attribute'
from gitlab/metrics/instrumentation.rb:161:in `block in append_or_update_attribute'
from gitlab/metrics/method_call.rb:36:in `measure'
from gitlab/metrics/instrumentation.rb:161:in `append_or_update_attribute'
from gitlab/import_export/project_tree_restorer.rb:79:in `save_relation_hash'
from gitlab/import_export/project_tree_restorer.rb:173:in `block in create_sub_relations'
from active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
from active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
from monitor.rb:230:in `mon_synchronize'
from active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
from active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
from active_record/transactions.rb:212:in `transaction'
from gitlab/import_export/project_tree_restorer.rb:166:in `create_sub_relations'
from gitlab/import_export/project_tree_restorer.rb:63:in `block in create_relations'
from gitlab/import_export/project_tree_restorer.rb:61:in `each'
from gitlab/import_export/project_tree_restorer.rb:61:in `create_relations'
Associated ZD ticket: https://gitlab.zendesk.com/agent/tickets/131095
Workaround
See user suggested workaround to remove the notes: gitlab-foss#63955 (comment 187769972)
Edited by Cynthia "Arty" Ng