Error uploading pdf image

164 views
Skip to first unread message

jesus san miguel

unread,
Oct 30, 2020, 2:25:45 PM10/30/20
to AtoM Users
Hi all,

I have an error in two different servers running AtoM 2.5.3-172 when I upload a PDF image through the GUI.
The error ends being NULL digital_object.path value:

This is from nginx.log:

2020/10/30 18:02:48 [error] 928#928: *577 FastCGI sent in stderr: "PHP message: Unable to execute INSERT statement. [wrapped: SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value]" while reading response header from upstream, client: 95.120.153.214, server: _, request: "POST /index.php/testing/object/addDigitalObject HTTP/1.1", upstream: "fastcgi://unix:/run/php7.2-fpm.atom.sock:", host: "188.164.195.165", referrer: "http://188.164.195.165/index.php/testing/object/addDigitalObject"

And this is the database insert log:

2020-10-30T18:02:48.621153Z     4 Query INSERT INTO object (`CLASS_NAME`,`CREATED_AT`,`UPDATED_AT`) VALUES ('QubitDigitalObject','2020-10-30 11:02:48','2020-10-30 11:02:48')
2020-10-30T18:02:48.621513Z     4 Query INSERT INTO digital_object (`ID`,`OBJECT_ID`,`PATH`,`PARENT_ID`) VALUES (223394,223393,'',223392)
2020-10-30T18:02:48.622005Z     4 Query ROLLBACK

If I upload the digital object through the cli, it works as expected:

root@ubuntu18:/usr/share/nginx/atom# php symfony digitalobject:load --path="/root/" --index /root/niatiros.csv
>> digital-object Load digital objects from /root/niatiros.csv...
(Oct 30, 09:41:48 AM) Loading 'niatiros.pdf' (1 of 1 remaining)
>> digital-object Successfully Loaded 1 digital objects.
root@ubuntu18:/usr/share/nginx/atom# 

Best,
Jesus.

José Raddaoui

unread,
Nov 2, 2020, 10:56:23 AM11/2/20
to AtoM Users
Hi Jesús,

This is probably caused by having STRICT_TRANS_TABLES enabled in MySQL's sql_mode. We recently changed this section in the documentation (here for 2.5) to reflect the need of removing it and we have this ticket to support it in future versions, where I've added a note to this post.

Thanks for letting us know about this issue.

Best regards,
Radda.

José Raddaoui

unread,
Nov 2, 2020, 11:48:41 AM11/2/20
to AtoM Users
Hi again Jesús,

Thinking it through, in a GUI upload the path shouldn't be null and, additionally, we addressed that issue in https://projects.artefactual.com/issues/13144. And, reading the error again, it looks like it's actually complaining about the 'name' column instead of the path. Not sure what could be causing an empty name in GUI uploads, maybe it's related to encoding, web server permissions, or the file path in the CSV.

Bests,
Radda.

jesus san miguel

unread,
Nov 2, 2020, 12:45:59 PM11/2/20
to ica-ato...@googlegroups.com
Hi Radda,

Let me exclude a bunch of maybes: If it is a JPG instead of a PDF, the
upload works smooth as silk, so, lets discard encoding, web server
permissions and the CSV file path, since this is a GUI upload. I tried
tweaking policies in imagemagik conf file, but so far I'm concerned
about the SQL insert failing. Why would path variable be empty when I
upload a PDF and have a value if I upload a JPG? Aren't they uploaded
in the same folder structure inside ./uploads/r/...?
> --
> You received this message because you are subscribed to a topic in the Google Groups "AtoM Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ica-atom-users/PMB-fHLDLhQ/unsubscribe.
> To unsubscribe from this group and all its topics, 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/6b7a8866-0206-4785-a3f6-f49c06ca5270n%40googlegroups.com.

jesus san miguel

unread,
Nov 3, 2020, 5:36:49 AM11/3/20
to ica-ato...@googlegroups.com
Perhaps this might be of use to diagnose the error...

On Mon, Nov 2, 2020 at 5:48 PM José Raddaoui <jrad...@artefactual.com> wrote:
>
General error_1364 Field 'name' doesn't have a default value.pdf

José Raddaoui

unread,
Nov 4, 2020, 12:09:57 PM11/4/20
to AtoM Users

Hi Jesús,

It looks like the issue happens with the digital object name, not the path and, seeing those logs, maybe it's the normal behavior in the PDF compound children (see setting docs). So it could be STRICT_TRANS_TABLE enabled in the sql_mode what is actually making it appear as an error instead of a warning. I'll give it a try locally and let you know how it goes.

Bests.

jesus san miguel

unread,
Nov 6, 2020, 5:59:28 AM11/6/20
to ica-ato...@googlegroups.com
Yes, you were right on the spot! Removing STRICT_TRANS_TABLE in
/etc/mysql/conf.d/mysql.cnf did finally the trick.

Don't forget enable read on /etc/ImageMagick-6/policy.xml

<policy domain="coder" rights="read" pattern="PDF" />

Thanks!
> To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/37188e05-e516-4b73-ace7-78db8232dec0n%40googlegroups.com.

José Raddaoui

unread,
Nov 6, 2020, 12:28:20 PM11/6/20
to AtoM Users
Good news Jesús, thanks for reporting back!
Reply all
Reply to author
Forward
0 new messages