Problem uploading using Python code
gat1234
Registered Users Posts: 3 Beginner grinner
I have a Python script that used to work just fine to upload photos and videos. It uses the 1.2.0 API and the RAW HTTP POST method. Unfortunately, for the last couple of weeks it fails consistently with the following JSON response:
{"stat":"fail","code":5,"message":"system error (nofiles)"}
Nothing is showing up in the upload log on SmugMug.
Nothing has changed on my end so it seems like something changed at SmugMug. Any idea how I can get this working again? I can provide some sample code if necessary.
I have no trouble uploading using the Java applet.
Thanks!
{"stat":"fail","code":5,"message":"system error (nofiles)"}
Nothing is showing up in the upload log on SmugMug.
Nothing has changed on my end so it seems like something changed at SmugMug. Any idea how I can get this working again? I can provide some sample code if necessary.
I have no trouble uploading using the Java applet.
Thanks!
0
Comments
I'm having the same issue. I sent an email to Smug Mug. The response said that they were passing my email off to one of the Developers, but I haven't heard anything back yet.
Same issue here. I am using a python upload script based off of the example here:
http://scottmoonen.com/tag/smugmug-python-upload-picture-image-gallery-script-api/
Can we get an update or at least an acknowledgement that this is being addressed.
I am getting a large backlog of photos. My business depends on this python script to upload photos with keyword information included (a separate app browses photos locally and assigns keyword as prep for automated upload by python script) to enable search interface to show appropriate pics. With this functionality not working I am stuck unable to load photos from recent events. Please confirm this is being looked at.
Users can easily resolve this issue by adding the following line of code ('Content-Type': 'none')...
I'd like to note that issues relating to 3rd apps are the responsibility of the developer and not SmugMug. While SmugMug is happy to help out as always, technical resources may not be available at the drop of a hat.
Cheers,
David
SmugMug API Developer
My Photos
Thanks David!
I've updated pymug accordingly (diff)
Would you mind updating the documentation for the "RAW HTTP Post method" to note the Content-Type: 'none' restriction? I'm not trying to be argumentative, but I do feel this is an API change.
I have updated my Aperture plugin to set the content-type to none (previously it set image/jpeg) but one of my users is still getting errors on replace, upload seems fine apparently but he is getting failures:
2010/07/17 21:23:39 WARN +[RLSmugMugImage uploadImage:replaceExisting:forSession:andError:] <> - Image upload failed {
code = 4;
message = "wrong format ()";
method = "smugmug.images.replace";
stat = fail;
}
the full headers for the posted images are as follows:
2010/07/17 21:23:39 WARN -[RLSmugMugRequestMethodHelper uploadImageSynchronousRequest:replaceExisting:withArguments] <> - Upload failed header fields : {
"Content-Length" = 2667078;
"Content-Md5" = 4c324364ddefece453add096656b15a9;
"Content-Type" = none;
"User-Agent" = "SmuginPro/1.1";
"X-Smug-Albumid" = 12680086;
"X-Smug-Caption" = "2009-12-29%20-%20Elk%20Sled%20Ride%20-%20007";
"X-Smug-Filename" = "2009-12-29%20-%20Elk%20Sled%20Ride%20-%20007.jpeg";
"X-Smug-Imageid" = 933566263;
"X-Smug-Keywords" = "Annalisa,Idaho,April,Tilmant,2009,SmuginProForAperture";
"X-Smug-Responsetype" = JSON;
"X-Smug-Sessionid" = 0cdbb4bd3eba7e5b0578c96dd7fafc7d;
"X-Smug-Version" = "1.2.2";
}
I don't understand why one user can have issues and others not.
For clarification, we don't specifically need the Content-Type set to none. For some reason, python defaults to a Content-Type of 'application/x-www-form-urlencoded' for POST. I've written a lot of uploading code in default languages and never experienced this before.
So in this case, setting the Content-Type to none is the only way to stop python from being stupid.
SmugMug API Developer
My Photos
Success! Thanks for the info about the content-type.
fwiw, my script has been running as-is without issue for 16 months, so something on smugmug's end has changed. I don't think this can be fully blamed on python.
Appreciate this being looked into.
2010/07/18 11:25:38 DEBUG -[RLSmugMugRequestMethodHelper uploadImageSynchronousRequest:replaceExisting:withArguments] <> - Header fields : {
"Content-Length" = 2569212;
"Content-Md5" = 20797218b1ff89b0190bf7ae3c4841da;
"Content-Type" = none;
"User-Agent" = "SmuginPro/1.1";
"X-Smug-Albumid" = 12680086;
"X-Smug-Caption" = "2009-12-29%20-%20Elk%20Sled%20Ride%20-%20009";
"X-Smug-Filename" = "2009-12-29%20-%20Elk%20Sled%20Ride%20-%20009.jpeg";
"X-Smug-Imageid" = 933566458;
"X-Smug-Keywords" = "Alan,Idaho,Tilmant,2009";
"X-Smug-Responsetype" = JSON;
"X-Smug-Sessionid" = a71bc7248506f9d2277af6ceacaf8c49;
"X-Smug-Version" = "1.2.2";
}
2010/07/18 11:25:49 DEBUG -[RLSmugMugRequestMethodHelper connection:didReceiveResponse:] <> - Received response <NSHTTPURLResponse: 0x2b90bcb0>
2010/07/18 11:25:49 DEBUG -[RLSmugMugRequestMethodHelper connectionDidFinishLoading:] <> - JSON: {
Image = {
Key = udPS8;
URL = "http://photos.tilmant.com/Family/All-Photos/12680086_qecLu#933566458_udPS8";
id = 933566458;
};
method = "smugmug.images.replace";
stat = ok;
}
and for the failure case
2010/07/18 11:26:54 DEBUG -[RLSmugMugRequestMethodHelper uploadImageSynchronousRequest:replaceExisting:withArguments] <> - Header fields : {
"Content-Length" = 1735212;
"Content-Md5" = 8e221eed4542cd2a530ff1a4e5cbe466;
"Content-Type" = none;
"User-Agent" = "SmuginPro/1.1";
"X-Smug-Albumid" = 12680086;
"X-Smug-Caption" = "2009-12-29%20-%20Elk%20Sled%20Ride%20-%20020";
"X-Smug-Filename" = "2009-12-29%20-%20Elk%20Sled%20Ride%20-%20020.jpeg";
"X-Smug-Imageid" = 933567602;
"X-Smug-Keywords" = "Tilmant,Tom,2009,Idaho,Bette,Merle,Reid,Gene,Lisa";
"X-Smug-Responsetype" = JSON;
"X-Smug-Sessionid" = 42b7b96260fa09d5eb2b85305263df34;
"X-Smug-Version" = "1.2.2";
}
2010/07/18 11:27:39 DEBUG -[RLSmugMugRequestMethodHelper connection:didReceiveResponse:] <> - Received response <NSHTTPURLResponse: 0x3f76da30>
2010/07/18 11:27:39 INFO -[RLSmugmugResponse initWithDictionary:] <> - Request failed : {
code = 4;
message = "wrong format ()";
method = "smugmug.images.replace";
stat = fail;
}
Once it has failed it continues to fail for any subsequent images.
Any ideas would be appreciated.