Jump to content

Some downloaded images don't end up to database


Roope
 Share

Recommended Posts

Hi! I have this annoying problem on one of my clients site using latest dev.

When images are uploaded, all of them show up to image field and files are transferred correctly to page folder. After page save some random images disappear from field.

Couple of times I received error during upload (page id 1090):

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1090-0' for key 1

Though usually there's nothing and no errors show up to log file.

I've tried to add files one by one or by dragging several at the time and no difference. Some images get lost in the way. It can be one from two uploaded files or one from eight. File that gets skipped can be uploaded fine next time.

PHP version is 5.3.23 and mysql 5.0.8-dev. Memory limit 256M.

Any help would be much appreciated!

Link to comment
Share on other sites

From that message, it seems MySQL is not happy. Google throws up all sorts of reasons/solutions for that MySQL message:

1. Spaces in filenames

2. Attempt to insert a duplicate value in a column set to be unique

3. Emptying cache..

etc..

Edited by kongondo
Link to comment
Share on other sites

It sounds like a potential bug in there, but I can't duplicate it yet. I've been dragging in lots of images, saving, etc. Any specific combination of factors you think might be involved (specific sorting actions, etc.)? What other 3rd party modules are installed? Any JS errors?

Link to comment
Share on other sites

Thanks for the reply guys!

There's only couple of site modules installed that I don't think is doing any harm here (Import Pages from CSV, Email Obfuscation (EMO), Export Site Profile, Video embed for YouTube/Vimeo). I haven't noticed any JS errors or anything. That MySQL error I posted before is the only one.

I just intalled site on localhost running PHP 5.4.10 and MySQL 5.5.29 and all images are saved correctly so I think this may have something to do with old MySQL version that hosting company has installed (5.0.8). I do have couple of other sites on that same server though and haven't noticed any problems before. There is no option to choose another version so I can't test it at the moment on live server.

I also didn't succeed to install this site from SQL-dump created by Export Site Profile. There was some errors during installation:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name1010' in 'field list'

and when I try to enter admin or view any page it just throws:

Error: Call to a member function isDefault() on a non-object (line 490 of /Users/Roope/Sites/demo/wire/modules/LanguageSupport/LanguageSupportPageNames.module) 

Wire folder was fresh copy from dev branch (last update today 02.09.2013)

Link to comment
Share on other sites

The issue with the profile export is just that the profile exporter was built before multi-language support was, so it doesn't know about it. It's on my to-do list to update it. But since you are using multi-language, I would take the profile exporter out of the equation here and try to do your export/import with PhpMyAdmin (or another mysql client) instead. I'm not positive, but wasn't MySQL 5.0.8 the one with the sort bug? Otherwise, I'm not aware of any issues with that version of MySQL. Technically, PW can actually use later versions of MySQL 4 too, even if we don't document that. 

Link to comment
Share on other sites

OK, so I re-tested this issue on PHP 5.3.23 and mysql 5.0.8 server using both; dev and master branches. On fresh install issue exists with both of them.

There is actually Break Notification on page load when image field is attached to it: JSON.parse: unexpected character.

But it so it does on local machine also where image upload works as expected.

Link to comment
Share on other sites

You just posted the jQuery minified source code there. :) I'm a little confused and not sure exactly what we're talking about now (still profile exporter?). What are the steps to reproduce the issue? And are we still talking about a MySQL issue, or a Javascript one?

Link to comment
Share on other sites

Sorry about that jQuery.. edited and deleted.

That profile exporter issue was just a side note that I noticed when I was trying to solve the main issue:

Some images do not end up to database during upload and that's why they dissapear from input field after page save. All images do trasfer to filesystem correctly.

So I belive it's a MySQL issue since only setup where I can reproduce this is at PHP 5.3.23 / MySQL 5.0.8 (although tested only couple of different combinations available). I can PM you some login details to live site if you wan't to go explore.

That jQuery break notification on firebug probably has nothing to do with this.

  • Like 1
Link to comment
Share on other sites

I'd tend to agree with you that it might be specific to that version of MySQL or something else specific to the server. But I'm going to keep an eye out for anyone else reporting something similar. If there's a problem there, it'll appear elsewhere, and that'll be a good signal to start debugging it. But so far I can't duplicate, so am thinking we should avoid debugging this too much until there's some indication it goes beyond 1 server.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...