Opened 9 years ago

Closed 8 years ago

#448 closed defect (fixed)

SQLAlchemy session error [was: JPG upload fails]

Reported by: Jakob Kramer Owned by: joar
Priority: major Milestone:
Component: programming Keywords: upload, submit
Cc: Parent Tickets:

Description

After I had set up a completely fresh MediaGoblin development environment, started ./lazyserver and created a new user account, I tried to upload a JPG file, but it failed with the attached error message.

I can upload PNG files, though. (And I am using the PIL from the package manager of Ubuntu (12.04). ;))

Subtickets

Attachments (2)

mg.log (117.0 KB) - added by Jakob Kramer 9 years ago.
The error message
DSC_0608.JPG (233.0 KB) - added by JarlNicolson 8 years ago.

Download all attachments as: .zip

Change History (21)

Changed 9 years ago by Jakob Kramer

Attachment: mg.log added

The error message

comment:1 Changed 9 years ago by Jakob Kramer

Priority: majorblocker

comment:2 Changed 9 years ago by Jakob Kramer

This problem seems to exist with at least the JPG image I attached to this issue, but not with others.

comment:3 Changed 9 years ago by Jakob Kramer

Oh, maybe this has something to do with the issue #419 (“MediaGoblin can't handle (upload?) Large files”). I thought, “large files” were very large files (e.g. videos), but maybe they are big images (like mine…).

comment:4 Changed 9 years ago by Jakob Kramer

Resolution: duplicate
Status: newclosed

comment:5 Changed 8 years ago by Jakob Kramer

Keywords: upload submit added
Priority: blockercritical
Resolution: duplicate
Status: closedreopened

Seems to be another issue.

comment:6 Changed 8 years ago by Christopher Allan Webber

Priority: criticalmajor
Summary: JPG upload failsSQLAlchemy session error [was: JPG upload fails]

It looks like it isn't actually PIL or image processing related at all. The error shown here is an SQLAlchemy session error. Updating the title appropriately.

This ticket needs steps to reproduce the error though.

comment:7 Changed 8 years ago by Jakob Kramer

If you try to upload `this image <https://dl.dropbox.com/u/18835355/images/IMG_0139.jpg>`_ on a MediaGoblin site you will get this error message.  I tried it on my local host and mediagoblin.com.
Last edited 8 years ago by Jakob Kramer (previous) (diff)

comment:8 Changed 8 years ago by JarlNicolson

I am seeing the same error while uploading JPGs converted from RAW files. I'm not sure if it's related, but the exif data it's trying to insert doesn't look to be valid JSON - the strings should be wrapped in double quotes not single and the numbers shouldn't have the 'L' after them. Not sure why that would make SQL Alchemy throw Unicode errors though..

I'm not really a programmer but i'll see if I can work through how that exif data is extracted and see if I can cleanup the output.

comment:9 Changed 8 years ago by Christopher Allan Webber

JarlNicolson: I think this might have been resolved and I forgot to close it, but let's see. Could you try doing this:

./bin/easy_install -UaZ SQLAlchemy

Which should force an upgrade of sqlalchemy to the latest one. Then restart mediagoblin and see if you get the same error.

comment:10 Changed 8 years ago by JarlNicolson

Unfortunately no luck - I actually only started playing with MediaGoblin yesterday so I already had the most up to date version of SQLAlchemy.

As a work around I can disable the detailed output from EXIF.py (in mediagoblin\tools\exif.py - change process_file(image) to process_file(image, details=False) ), it seems as though the hex values were only in the MakerNote EXIF data.

Unfortunately I got stuck trying to figure out what to do next - to me it seems like it could be a bug with the EXIF-py output, unescaped backslashes, but I'm very new at this :)

comment:11 Changed 8 years ago by Christopher Allan Webber

Okay, thanks for that information.

Could you upload an example image that breaks mediagoblin and attach it to this ticket? That might help if we can reproduce it.

Changed 8 years ago by JarlNicolson

Attachment: DSC_0608.JPG added

comment:12 Changed 8 years ago by JarlNicolson

File attached. The image gandaro linked to also causes the problem for me (again, hex in a string inside the exif)

comment:13 Changed 8 years ago by joar

Owner: set to joar
Status: reopenedaccepted

comment:14 Changed 8 years ago by joar

Resolution: fixed
Status: acceptedclosed

Pushed a fix for this to master and tested it on https://gobblin.se!

comment:15 Changed 8 years ago by JarlNicolson

Works perfectly for me! Thanks!

comment:16 Changed 8 years ago by Jakob Kramer

Resolution: fixed
Status: closedreopened

It still does not work. Try with the image I referenced above.

comment:17 Changed 8 years ago by JarlNicolson

I tried the two images (Mine and yours) in both a brand new local install and on https://gobblin.se - both were successful for me.

comment:18 Changed 8 years ago by Jakob Kramer

I tried only on mediagoblin.com.

comment:19 in reply to:  18 Changed 8 years ago by joar

Resolution: fixed
Status: reopenedclosed

Replying to gandaro:

I tried only on mediagoblin.com.

I'm don't think mediagoblin.com was updated at the time you tried. It might be now though, try again, otherwise ask cwebber to update. I'm closing this issue as fixed meanwhile :)

Note: See TracTickets for help on using tickets.