Skip to first unread message

PEDRO BEZERRA

unread,
Nov 14, 2023, 11:48:24 AM11/14/23
to AtoM Users
Hello

We recently switched to version 2.7 of atom, before we were operating on an older version, and we were able to import via CSV, but in this version every spreadsheet that I attached presents an error and does not run, even the example spreadsheets found on the website atom official also presents an error, could someone tell me what could be happening, could I forward a spreadsheet model to base it on?

Below is an error that is showing

Error(s)
2023-11-14 08:31:02 php '/usr/share/nginx/atom/symfony' 'csv:import' --index     --user-id="173535" --quiet --source-name='Example_information_objects_isad-2.6 (2).csv' --default-parent-slug='biblioteca-teste' '/usr/share/nginx/atom/uploads/tmp/TMPbe7e38a5.csv';   Unable to execute INSERT statement. [wrapped: SQLSTATE[HY000]: General error: 1364 Field 'lft' doesn't have a default value]

Log
[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": Job started.
[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": Parameters: {"index":true,"doCsvTransform":false,"skip-unmatched":false,"skip-matched":false,"parentId":"173583","objectType":"informationObject","importType":"csv","update":"import-as-new","repositorySlug":"","collectionSlug":null,"file":{"name":"Example_information_objects_isad-2.6 (2).csv","type":"text\/csv","tmp_name":"\/usr\/share\/nginx\/atom\/uploads\/tmp\/TMPbe7e38a5.csv","error":0,"size":2874},"name":"arFileImportJob","id":"228777"}
[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": Importing CSV file: Example_information_objects_isad-2.6 (2).csv.
[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": Validating file: Example_information_objects_isad-2.6 (2).csv.
[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": CSV Results:
------------------------------------------------------
Filename: Example_information_objects_isad-2.6 (2).csv
------------------------------------------------------
Errors: 0
Warnings: 0

No issues detected.

[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": Creating ZIP file /usr/share/nginx/atom/downloads/jobs/a533c11b8b61a6216e40c2c3a90ef65c.zip.
[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": Deleting temporary job directory /tmp/5fdb9e8da62b76e47dd73923b5e95414
[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": Indexing imported records.
[info] [2023-11-14 08:31:01] Job 228777 "arFileImportJob": Update type: import-as-new
[err] [2023-11-14 08:31:02] Job 228777 "arFileImportJob": php '/usr/share/nginx/atom/symfony' 'csv:import' --index     --user-id="173535" --quiet --source-name='Example_information_objects_isad-2.6 (2).csv' --default-parent-slug='biblioteca-teste' '/usr/share/nginx/atom/uploads/tmp/TMPbe7e38a5.csv';   Unable to execute INSERT statement. [wrapped: SQLSTATE[HY000]: General error: 1364 Field 'lft' doesn't have a default value]
[info] [2023-11-14 08:31:02] Job 228777 "arFileImportJob": Job finished.


Dan Gillean

unread,
Nov 14, 2023, 3:24:03 PM11/14/23
to ica-ato...@googlegroups.com
Hi Pedro, 

Any time you see an error that involves lft or rgt, try rebuilding the nested set, as this is what these values refer to, and doing so may resolve the error. At least, that would be my first suggestion! See:
Meaning: I don't think the problem is with the CSV file, so much as with the "biblioteca-teste" parent record. 

Other good tasks you could try running that often help resolve many common issues: 
  • Generate slugs: run without any parameters, it will add slugs for any main entities that are missing them
  • Clearing the application cache and restarting PHP-FPM - ensuring that you are seeing the most up-to-date data, and not an outdated cached version
Further information and links for these tasks can all be found on the same Troubleshooting documentation page linked above. 

Finally, don't forget that in 2.7 there is now a way to validate your CSV before importing, to ensure that it is well-formed. See: 

Let us know how it goes, and if this allows you to import as expected!

 Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


Unifor.br | Instagram | Facebook | Twitter LinkedIn | TV Unifor | G1/Ensinando e Aprendendo


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/66f56a54-7624-4a60-adf0-42f16d7951d7n%40googlegroups.com.
Message has been deleted

Dan Gillean

unread,
Nov 16, 2023, 12:03:17 PM11/16/23
to ica-ato...@googlegroups.com
Hi Matheus, 

Did you remember to drop and then recreate the database BEFORE loading your 2.3.1 sqldump?
  • mysql -u username -p -e "DROP DATABASE IF EXISTS atom;"
  • mysql -u username -p -e "CREATE DATABASE atom CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;"
Did you remember to run the tools:upgrade task AFTER loading your sqldump?
  • php -d memory_limit=-1 symfony tools:upgrade-sql
Did you also remember to repopulate the search index, clear the application cache, and restart services after running the upgrade task?
  • php -d memory_limit=-1 symfony search:populate
  • php symfony cc
  • sudo systemctl restart php7.4-fpm
  • sudo systemctl restart memcached
  • sudo systemctl restart atom-worker
  • sudo systemctl status atom-worker
  • sudo systemctl reload nginx
All of these steps are part of the Upgrading documentation. Pardon me for being pedantic, but it's good to check - we often discover that upgrade issues are a result of a missed step in the process, so I am just trying to rule out the obvious first. 

Otherwise, if you have done all that, have you tried the solution I suggested earlier in this thread to Pedro - running the build nested set and generate slugs tasks?
  • php symfony propel:build-nested-set
  • php symfony propel:generate-slugs
What exactly is triggering the error in your instance (in Pedro's case it was attempting to run a CSV import)? Can you share the exact error log output and the steps that led to that error for us?

Finally: releases 2.7.2 and 2.7.2 include additional security patches and bug fixes. Is there any specific reason you are upgrading to 2.7.1 and not the latest release, 2.7.3?

Thanks in advance!

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


On Thu, Nov 16, 2023 at 11:36 AM MATHEUS SOUZA <matheu...@unifor.br> wrote:
Good afternoon, I'm experiencing the same problem after I imported the database data from version 2.3.1 to 2.7.1.
Reply all
Reply to author
Forward
0 new messages