Opened 13 years ago

Closed 12 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). ;))

Attachments (2)

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

Download all attachments as: .zip

Change History (21)

by Jakob Kramer, 13 years ago

Attachment: mg.log added

The error message

comment:1 by Jakob Kramer, 13 years ago

Priority: majorblocker

comment:2 by Jakob Kramer, 13 years ago

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

comment:3 by Jakob Kramer, 13 years ago

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 by Jakob Kramer, 13 years ago

Resolution: duplicate
Status: newclosed

comment:5 by Jakob Kramer, 13 years ago

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

Seems to be another issue.

comment:6 by Christopher Allan Webber, 13 years ago

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 by Jakob Kramer, 13 years ago

If you try to upload `this image <https://www.dropbox.com/s/8xzimbf5fisdw14/IMG_9818.jpg>`_ on a MediaGoblin site you will get this error message.  I tried it on my local host and mediagoblin.com.
Version 0, edited 13 years ago by Jakob Kramer (next)

comment:8 by JarlNicolson, 12 years ago

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 by Christopher Allan Webber, 12 years ago

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 by JarlNicolson, 12 years ago

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 by Christopher Allan Webber, 12 years ago

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.

by JarlNicolson, 12 years ago

Attachment: DSC_0608.JPG added

comment:12 by JarlNicolson, 12 years ago

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

comment:13 by joar, 12 years ago

Owner: set to joar
Status: reopenedaccepted

comment:14 by joar, 12 years ago

Resolution: fixed
Status: acceptedclosed

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

comment:15 by JarlNicolson, 12 years ago

Works perfectly for me! Thanks!

comment:16 by Jakob Kramer, 12 years ago

Resolution: fixed
Status: closedreopened

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

comment:17 by JarlNicolson, 12 years ago

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 by Jakob Kramer, 12 years ago

I tried only on mediagoblin.com.

in reply to:  18 comment:19 by joar, 12 years ago

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.