-
Notifications
You must be signed in to change notification settings - Fork 210
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
edge-alpine DB fails with an HEIC image for media_entity.metadataSizeWidth constraint #877
Comments
@malavolti I found the problem and a solution. May I use the picture you provided as test-material in the project (adding it to /test/backend/assets/)? |
Yes, sure! 😊 |
@malavolti Hey again I upgraded the image-size version in #879, but I actually found out that it incorrectly reports the dimensions of your photo as 512x512. It fixes the problem with null in pigallery, but it's still not correct. Would you mind me submitting the photo in a bug-report over at https://github.com/image-size/ ? |
Yes, no problem. Thank you! 😊 |
@malavolti If you have the opportunity to install the latest edge-version. The issue should be resolved by that. Otherwise, please let me know ;) |
I'll try as soon as possible! 😊 Thank you for all! |
@bpatrik I think this is merged, so should probably be added to the "Next (probably v2.5)" milestone? |
Can someone confirm that the original issue was fixed? |
Maybe @malavolti is still around to test latest edge build? |
Dear @grasdk I've test the only the image that I shared with you in the past and the latest edge build fails with the same error of the issue I have opened in April. 5/16/2024, 10:19:52 PM[INFO_][server] running diagnostics...
5/16/2024, 10:19:52 PM[INFO_][SQLConnection] Updating database scheme
5/16/2024, 10:19:52 PM[WARN_][ConfigDiagnostics] Jobs error. Resetting to default for now to let the app start up. Please adjust the config properly. Error: Unknown Job :Thumbnail Generation
5/16/2024, 10:19:52 PM[INFO_][JobManager] Running job schedules
5/16/2024, 10:19:52 PM[INFO_][server] Listening on port 80
QueryFailedError: SqliteError: NOT NULL constraint failed: media_entity.metadataSizeWidth
at BetterSqlite3QueryRunner.query (/app/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3QueryRunner.js:103:19)
at async InsertQueryBuilder.execute (/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async SubjectExecutor.executeInsertOperations (/app/node_modules/typeorm/persistence/SubjectExecutor.js:260:42)
at async SubjectExecutor.execute (/app/node_modules/typeorm/persistence/SubjectExecutor.js:92:9)
at async EntityPersistExecutor.execute (/app/node_modules/typeorm/persistence/EntityPersistExecutor.js:148:21)
at async IndexingManager.saveChunk (/app/src/backend/model/database/IndexingManager.js:400:20)
at async IndexingManager.saveMedia (/app/src/backend/model/database/IndexingManager.js:329:9)
at async IndexingManager.saveToDB (/app/src/backend/model/database/IndexingManager.js:95:13)
at async IndexingManager.queueForSave (/app/src/backend/model/database/IndexingManager.js:128:17) {
query: 'INSERT INTO "media_entity"("id", "name", "type", "directoryId", "metadataCaption", "metadataTitle", "metadataCreationdate", "metadataCreationdateoffset", "metadataFilesize", "metadataKeywords", "metadataRating", "metadataFaces", "metadataPersons", "metadataPersonslength", "metadataBitrate", "metadataDuration", "metadataSizeWidth", "metadataSizeHeight", "metadataCameraDataIso", "metadataCameraDataModel", "metadataCameraDataMake", "metadataCameraDataFstop", "metadataCameraDataExposure", "metadataCameraDataFocallength", "metadataCameraDataLens", "metadataPositionDataCountry", "metadataPositionDataState", "metadataPositionDataCity", "metadataPositionDataGPSDataLatitude", "metadataPositionDataGPSDataLongitude") VALUES (NULL, ?, ?, 1, NULL, NULL, 1706438594000, 180, 2158564, NULL, NULL, NULL, NULL, 0, NULL, NULL, ?, ?, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 9.061331, 38.761711)',
parameters: [ '2024-01-28_13.43.14.heic', 'PhotoEntity', null, null ],
driverError: SqliteError: NOT NULL constraint failed: media_entity.metadataSizeWidth
at BetterSqlite3QueryRunner.query (/app/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3QueryRunner.js:85:38)
at async InsertQueryBuilder.execute (/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async SubjectExecutor.executeInsertOperations (/app/node_modules/typeorm/persistence/SubjectExecutor.js:260:42)
at async SubjectExecutor.execute (/app/node_modules/typeorm/persistence/SubjectExecutor.js:92:9)
at async EntityPersistExecutor.execute (/app/node_modules/typeorm/persistence/EntityPersistExecutor.js:148:21)
at async IndexingManager.saveChunk (/app/src/backend/model/database/IndexingManager.js:400:20)
at async IndexingManager.saveMedia (/app/src/backend/model/database/IndexingManager.js:329:9)
at async IndexingManager.saveToDB (/app/src/backend/model/database/IndexingManager.js:95:13)
at async IndexingManager.queueForSave (/app/src/backend/model/database/IndexingManager.js:128:17) {
code: 'SQLITE_CONSTRAINT_NOTNULL'
},
code: 'SQLITE_CONSTRAINT_NOTNULL'
} Rename the file to get the image.heic I've used the following docker-compose.yml and simply added services:
pigallery2:
image: bpatrik/pigallery2:edge-alpine
container_name: pigallery2
environment:
- NODE_ENV=production # set to 'debug' for full debug logging
# - NODE_OPTIONS=--enable-source-maps # enable source map support on the backend for development
volumes:
- "./config:/app/data/config"
- "./db-data:/app/data/db"
- "./images:/app/data/images:rw"
- "./tmp:/app/data/tmp"
ports:
- "85:80"
restart: always Thank you so much! |
Hey @malavolti Thank you for the input. Can you show the version of pigallery (click settings, hover over the app-version):
|
|
I see the build date is 5th of april. Before the fix. You may need to clear the edge build image from your docker installation to force an update. |
@malavolti thanks. So the issue here is resolved. But there is a new issue. However, it's about the image-size library. I reported the bug over there: image-size/image-size#403 |
Yeah we should track the HEIC image size issue somewhere. |
@bpatrik ok, done: #918 . I'll make a more comprehensive description if you would like. For now I just link to the issue with the image-size library. @malavolti do you agree that we can close this issue, given that there is another issue now for tracking the 512x512-problem? |
Yes, sure. I agree. Thank you for all! 😊 |
@malavolti thank you too. To think out in open issues, I would suggest closing the issue if you have access to that. Otherwise maybe @bpatrik can do it ;) |
Describe the bug
If I try to load this image, I receive the following error on SQLLite DB and no images are loaded on my piGallery2.
Photo/video (optional) that causes the bug
https://we.tl/t-pEdQHVDG4W
Server logs (optional)
Environment (please complete the following information):
Used app version:
The text was updated successfully, but these errors were encountered: