Closed whit1206 closed 5 years ago
Hi,
Here's my analysis of what's happened.
To here it seems OK:
2014-04-11 00:17:27,092 Uploading image ... 2013-03-10 14.50.39.jpg with tags #...
Generating set Albania Chris with 40 pictures
The fishy thing is that there were not 40 pictures uploaded so far. Then it gives this error:
Traceback (most recent call last):
...
File "/Users/chris/Desktop/folders2flickr/f2flickr/flickr.py", line 169, in __str__
return '<Flickr Photo %s>' % self.id
File "/Users/chris/Desktop/folders2flickr/f2flickr/flickr.py", line 109, in __getattr__
self._load_properties()
File "/Users/chris/Desktop/folders2flickr/f2flickr/flickr.py", line 120, in _load_properties
data = _doget(method, photo_id=self.id)
File "/Users/chris/Desktop/folders2flickr/f2flickr/flickr.py", line 854, in _doget
return _get_data(minidom.parse(urlopen(url)))
File "/Users/chris/Desktop/folders2flickr/f2flickr/flickr.py", line 885, in _get_data
raise FlickrError, msg
FlickrError: ERROR [1]: Photo "13774050564" not found (invalid ID)
This is not very user friendly, but checking the code indicates that this is caused by the flickr API giving back an error. Basically the photo it wants to use for the set's main image was not uploaded/does not exist. This is very odd, as the ID is not something the script invents - it is a number it gets back from flickr.
Could it be that the history file had left overs from a previous session? e.g. a photo that is not in the "Kiva Stuff" folder but that was uploaded via this script previously? That would explain this problem (though not excuse it, it should be handled more gracefully)
Logged from file tags2set.py, line 42
2014-04-11 00:17:49,641 tags2set: Cannot create set "Albania Chris"
2014-04-11 00:17:49,641 ERROR [2]: Invalid primary photo id (13774050564)
This is more of the same.
2014-04-11 00:17:49,642 <class 'f2flickr.flickr.FlickrError'>
2014-04-11 00:17:49,642 tags2set: Cannot edit set Albania Chris
2014-04-11 00:17:49,642 'NoneType' object has no attribute 'editPhotos'
2014-04-11 00:17:49,642 <type 'exceptions.AttributeError'>
This is caused by the initial failure, which snowballs a bit. After that uploads continue for a bit:
2014-04-11 00:17:49,691 Uploading image ...
...
2014-04-11 00:21:34,096 Uploading image 2013-03-10 14.56.52.jpg
2014-04-11 00:21:45,951 (<class 'urllib2.URLError'>, URLError(error(60, 'Operation timed out'),), <traceback object at 0x10e394290>)
2014-04-11 00:21:46,093 Uploading image 2013-03-10 14.57.22.jpg
Here there was an upload/URL connection timing out that caused a problem and it was not retried. Again, could be better.
Generating set Albania Chris with 61 pictures
Again, there were not 61 pictures uploaded so far, so this is getting data from elsewhere.
Traceback (most recent call last):
...
File "/Users/chris/Desktop/folders2flickr/f2flickr/flickr.py", line 120, in _load_properties
data = _doget(method, photo_id=self.id)
File "/Users/chris/Desktop/folders2flickr/f2flickr/flickr.py", line 854, in _doget
return _get_data(minidom.parse(urlopen(url)))
File "/Users/chris/Desktop/folders2flickr/f2flickr/flickr.py", line 885, in _get_data
raise FlickrError, msg
FlickrError: ERROR [1]: Photo "13774050564" not found (invalid ID)
The same missing ID.
Logged from file tags2set.py, line 42
2014-04-11 00:22:19,570 tags2set: Cannot create set "Albania Chris"
2014-04-11 00:22:19,570 ERROR [2]: Invalid primary photo id (13774050564)
2014-04-11 00:22:19,570 <class 'f2flickr.flickr.FlickrError'>
2014-04-11 00:22:19,570 tags2set: Cannot edit set Albania Chris
2014-04-11 00:22:19,571 'NoneType' object has no attribute 'editPhotos'
2014-04-11 00:22:19,571 <type 'exceptions.AttributeError'>
Same error as before. Uploads continue OK after this until:
2014-04-11 00:26:45,561 Uploading image ...
Generating set Albania Chris with 82 pictures
Traceback (most recent call last):
...
FlickrError: ERROR [1]: Photo "13774050564" not found (invalid ID)
Logged from file tags2set.py, line 42
2014-04-11 00:27:08,450 tags2set: Cannot create set "Albania Chris"
2014-04-11 00:27:08,450 ERROR [2]: Invalid primary photo id (13774050564)
2014-04-11 00:27:08,450 <class 'f2flickr.flickr.FlickrError'>
2014-04-11 00:27:08,450 tags2set: Cannot edit set Albania Chris
2014-04-11 00:27:08,450 'NoneType' object has no attribute 'editPhotos'
2014-04-11 00:27:08,450 <type 'exceptions.AttributeError'>
This is the same missing ID.
So, I think that the main problem here is that the history file had entries that are no longer on flickr and it has gotten confused. The fixes I could do would be to handle this more gracefully, and to also think about what to do about the time-out that was in the log (though here it has not caused any problems). Having an invalid ID causes several other errors and it isn't very clear what is wrong.
It appears the sets aren't being created at all. I cleared all images and sets from my flickr account using their website, then I took a folder on my desktop as the image directory and started the script. It uploaded most of the files ok but it failed to create any of the folders as sets.
Here is my config file:
Here is error output: