Open reinvented opened 12 years ago
Can you link to one of the 15%? Can you confirm if the 15% are the ones which contain non-ascii characters?
Here's the JPEG itself from one of the broken images:
http://farm4.staticflickr.com/3420/3387718988_2d6c8eb77a_o.jpg
And the Flickr record:
exiftool showed this
Warning : [minor] Unrecognized MakerNotes
Unsure if that has anything to do with it. Can you link to an original that did upload successfully?
Looking over the 679 JSON files that got dropping into the "errored" directory by the import.py script, I find that:
Here a JPEG that did import without issue:
http://farm4.staticflickr.com/3633/3644371417_704c05b6d7_o.jpg
And its Flickr record:
Would you mind doing a test?
Remove the single quote from one of the files as well as the html from another. Put both of those into the folder for processing and run the import script again and see what happens.
I tried the test as you suggested.
In both cases -- single quote removal and HTML removal -- the files imported successfully when the offending content was removed, which appears to suggest that it is, indeed, this that is the issue.
Thanks! Now to determine if it's in import, openphoto-python or frontend :)
This is just a shot in the dark after some poking around: I am wondering whether the addition of unicode-encoding the POST parameters is the cause of this issue?
Perhaps the parameters pre-encoded on POST are not matching the decoded parameters post-POST?
@reinvented: can you please confirm that this is working now?
The openphoto-python library has been renamed to "trovebox", so you'll need to install this first:
sudo pip install trovebox
See the updated readme for more details.
I'm also getting an oauth_problem=signature_invalid in my logs and the import script is spitting back FAILED: HTTP Error 401: Unauthorized. This seems to be for every photo, rather than just a few.
I've installed trovebox via pip just now, so I'm pretty sure it's the latest.
I've tried recreating the application on the site as well, no joy.
Any suggestions?
If it helps, I'm also getting PHP Notice: Array to string conversion in /var/www/open-photo/src/libraries/external/epi/EpiCache_File.php on line 57 at the same time...
This sounds a bit like an OAuth problem. You could try a couple of things from the command line:
First, view a list of photos:
trovebox -p -e /photos/list.json
That should return the first page of photos on your site.
If that works, try uploading a photo:
trovebox -p -X POST -e /photo/upload.json -F photo=@/path/to/photo.jpg
If you still get permissions failures, check that your config file (~/.config/trovebox/default) is set up correctly. See the README at https://github.com/photo/openphoto-python for more details.
The trovebox client won't work owing to a separate issue (for some reason it won't accept my ssl certificate), so I had to modify import.py as per https://github.com/photo/openphoto-python/issues/50 to get to this stage... is it possible to pass this parameter to trovebox CLI directly?
Indeed, the commandline client doesn't support self-signed SSL certificates. You can test with the Python bindings instead:
python
import trovebox
client = trovebox.Trovebox()
client.configure(ssl_verify=False)
Then try viewing a list of photos:
print(client.photos.list())
Then attempt an upload:
client.photo.upload("/path/to/photo.jpg")
If you still see problems, please try with an account on http://trovebox.com, to see whether this is a problem with your self-hosted installation.
Still no joy (yet to try the trovebox.com yet, will do), however looking at EpiCache_File.php, it looks like $value is an array...
Array ( [1379703081] => Array ( [153849330830113654701379703081] => 1 ) )
To me this looks like a serialisation problem, or possibly whatever is generating $value is wrong. The values being passed to the endpoint via file_put_contents is Array-1379707386
So I'm guessing the token is invalid here, making the 401 response consistent.
Not sure why $value is an array.
I exported 8133 photos from Flickr using the OpenPhoto export-flickr script. No problems encountered and I ended up with 8133 JSON files ready for OpenPhoto import.
Running the import.py script, I'm finding that about 15% of files get rejected with a oauth_problem=signature_invalid error, like this (oauth tokens obfuscated):
The remaining 85% of photos are imported with no issue at all.