question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Log shows SQL syntax error

See original GitHub issue

Description I get this errors in the log from docker. Looks like nothing is broken. Maybe it can be ignored?

Environment:

  • OS: Ubuntu - Docker:latest with database mysql
pigallery2    | QueryFailedError: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' '', '', DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAU...' at line 1
pigallery2    |     at new QueryFailedError (/app/node_modules/typeorm/error/QueryFailedError.js:11:28)
pigallery2    |     at Query.<anonymous> (/app/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:170:45)
pigallery2    |     at Query.<anonymous> (/app/node_modules/mysql/lib/Connection.js:526:10)
pigallery2    |     at Query._callback (/app/node_modules/mysql/lib/Connection.js:488:16)
pigallery2    |     at Query.Sequence.end (/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
pigallery2    |     at Query.ErrorPacket (/app/node_modules/mysql/lib/protocol/sequences/Query.js:92:8)
pigallery2    |     at Protocol._parsePacket (/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
pigallery2    |     at Parser._parsePacket (/app/node_modules/mysql/lib/protocol/Parser.js:433:10)
pigallery2    |     at Parser.write (/app/node_modules/mysql/lib/protocol/Parser.js:43:10)
pigallery2    |     at Protocol.write (/app/node_modules/mysql/lib/protocol/Protocol.js:38:16) {
pigallery2    |   code: 'ER_PARSE_ERROR',
pigallery2    |   errno: 1064,
pigallery2    |   sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' '', '', DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAU...' at line 1",
pigallery2    |   sqlState: '42000',
pigallery2    |   index: 0,
pigallery2    |   sql: "INSERT INTO `media_entity`(`id`, `name`, `type`, `directoryId`, `metadataCaption`, `metadataCreationdate`, `metadataFilesize`, `metadataKeywords`, `metadataOrientation`, `metadataBitrate`, `metadataDuration`, `metadataSizeWidth`, `metadataSizeHeight`, `metadataCameraDataIso`, `metadataCameraDataModel`, `metadataCameraDataMake`, `metadataCameraDataFstop`, `metadataCameraDataExposure`, `metadataCameraDataFocallength`, `metadataCameraDataLens`, `metadataPositionDataCountry`, `metadataPositionDataState`, `metadataPositionDataCity`, `metadataPositionDataGPSDataLatitude`, `metadataPositionDataGPSDataLongitude`, `metadataPositionDataGPSDataAltitude`) VALUES (DEFAULT, 'Senza titolo10.jpg', 'PhotoEntity', 55, DEFAULT, 1052231094000, 931932, DEFAULT, 1, DEFAULT, DEFAULT, 1783, 1200, , '', '', DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT)",
pigallery2    |   query: 'INSERT INTO `media_entity`(`id`, `name`, `type`, `directoryId`, `metadataCaption`, `metadataCreationdate`, `metadataFilesize`, `metadataKeywords`, `metadataOrientation`, `metadataBitrate`, `metadataDuration`, `metadataSizeWidth`, `metadataSizeHeight`, `metadataCameraDataIso`, `metadataCameraDataModel`, `metadataCameraDataMake`, `metadataCameraDataFstop`, `metadataCameraDataExposure`, `metadataCameraDataFocallength`, `metadataCameraDataLens`, `metadataPositionDataCountry`, `metadataPositionDataState`, `metadataPositionDataCity`, `metadataPositionDataGPSDataLatitude`, `metadataPositionDataGPSDataLongitude`, `metadataPositionDataGPSDataAltitude`) VALUES (DEFAULT, ?, ?, ?, DEFAULT, ?, ?, DEFAULT, ?, DEFAULT, DEFAULT, ?, ?, ?, ?, ?, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT)',
pigallery2    |   parameters: [
pigallery2    |     'Senza titolo10.jpg',
pigallery2    |     'PhotoEntity',
pigallery2    |     55,
pigallery2    |     1052231094000,
pigallery2    |     931932,
pigallery2    |     1,
pigallery2    |     1783,
pigallery2    |     1200,
pigallery2    |     [],
pigallery2    |     '',
pigallery2    |     ''
pigallery2    |   ]
pigallery2    | }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Magneticdudcommented, Apr 4, 2021

I confirm that with pigallery2:nightly-buster it managed to index all the previously problematic images without a single error

I can’t believe I’m running a snappy gallery of 50k+ photos on an orange pi with just 512mb ram ❤😍

1reaction
bpatrikcommented, Apr 4, 2021

This should be fixed now (with the latest nightly). Closing this. Feel free to reopen if it is still failing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to log syntax error. - Microsoft Q&A
I am trying to capture syntax error into try/catch block but its directly breaking the line from a code. Attachments: Up to 10...
Read more >
Debugging SQL: Syntax Errors animated with Gifs - Data School
Learn the most common reasons for SQL errors due to syntax. Spelling errors, Quotation marks, Capitalization, Data Types, and more.
Read more >
Common SQL syntax errors and how to resolve them
In this article, we are going to describe some of the most common SQL syntax errors, and explains how you can resolve these...
Read more >
SQL Error: "Syntax error at or near:" - Looker Community
This SQL error generally means that somewhere in the query, there is invalid syntax. Some common examples: Using a database-specific SQL for the ......
Read more >
Debugging SQL syntax errors - Metabase
Go to the line that is failing in your SQL query. · Check the SQL syntax on the line that is failing in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found