google-code-export / django-syncr

Automatically exported from code.google.com/p/django-syncr
0 stars 0 forks source link

syncing flickr fails, suspected update to flickr api could be the culprit #84

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. fs.syncAllPhotoSets(username)
2.
3.

What is the expected output? 
Expected to get all the photos for the user name synced

What do you see instead?
A KeyError related to photosizes. KeyError: u'Medium 640'

What version of the product are you using? On what operating system?
svn R 160, Ubuntu

Please provide any additional information below.
attached is the Traceback 

Original issue reported on code.google.com by nick.l...@gmail.com on 6 Aug 2010 at 3:17

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry i typoed that revision number, it should be 106 not 160.

Original comment by nick.l...@gmail.com on 6 Aug 2010 at 4:58

GoogleCodeExporter commented 9 years ago
I got exactly the same problem on a appache server. It doesn't seem to help to 
change the username. It happens with other syncing methods too.

I run django_syncr-0.50-py2.4

Django returns this traceback in debug mode:

Environment:

Request Method: GET
Request URL: http://olafmuller.com/soft_refresh
Django Version: 1.3 pre-alpha SVN-13569
Python Version: 2.4.4
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.comments',
 'OlafMuller.portfolio',
 'syncr.flickr',
 'tagging']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware')

Traceback:
File "/home/95866/data/python/django/django/core/handlers/base.py" in 
get_response
  100.                     response = callback(request, *callback_args, **callback_kwargs)
File "/home/95866/containers/django/OlafMuller/portfolio/views.py" in 
softSyncFlickr
  28.   return syncFlickr(request , "Soft refresh complete.")
File "/home/95866/containers/django/OlafMuller/portfolio/views.py" in syncFlickr
  37.   f.syncAllPublic(username = 'Olaf Muller')

Exception Type: KeyError at /soft_refresh
Exception Value: u'Medium 640'

Original comment by tutorial...@gmail.com on 11 Aug 2010 at 10:29

GoogleCodeExporter commented 9 years ago
I've traced the issue down, it's probably in the getPhotoSizes method.

Original comment by tutorial...@gmail.com on 11 Aug 2010 at 11:15

GoogleCodeExporter commented 9 years ago
The problem is related to a change in the format of the xml returned by flickr 
when calling the getSizes method. I'm not very good at this, but I will try to 
write a fix.

Original comment by tutorial...@gmail.com on 11 Aug 2010 at 12:01

GoogleCodeExporter commented 9 years ago
@everyone, my version makes it possible to sync with flickr again, so I suggest 
it gets tested and integrated in the current flickr lib asap, but it hasn't 
been tested (except that I synced some photo's and that worked, but I didn't do 
any other testing).

@nick.lang, I got a fix working. I just added the medium_640 value wherever I 
found a reference to medium. It might be a big pile of bugs though, but it 
worked for me. I think you should try it, since this at least works:p

I don't know how you got your script in your django installation, I've got mine 
installed in the python/lib folder. You'll have to reinstall it and update (or 
reinstall) your databases as well. I just deleted my current database and 
replaced it with a new one, but it had no important data in it that could not 
be replaced.

I stored the files in the folders they are in relative to the syncr main folder.

Good luck, let me know if it worked out!

Original comment by tutorial...@gmail.com on 11 Aug 2010 at 12:35

Attachments:

GoogleCodeExporter commented 9 years ago
@tutorialheaven

Thanks for the find! (sorry the late reply, been busy with my real job and my 
side projects have suffered for it! :(

Anyway I'll take a peek at what you've done there. 
I would really like to avoid having to redo the DB section that doesn't sound 
fun, especially when I've got a DB of approx 1000 photos already!

Original comment by nick.l...@gmail.com on 17 Aug 2010 at 5:11

GoogleCodeExporter commented 9 years ago
I know how it goes, stupid jobs, don't you wish you could mess around all day;)

If you'r running a mysql database you could try to modify it of course, (maybe 
with other databases too, I don't know) but I don't know how much tables Django 
creates for relations and such that might require adjustments too. Please, do 
backup before you try my fix, as I said, it hasn't been tested properly.

You could always resync your database of course, but that would take for ever:p

Good luck, let me know if it worked out!

Original comment by tutorial...@gmail.com on 17 Aug 2010 at 5:58

GoogleCodeExporter commented 9 years ago
@tutorialheaven

Ok what I've done is the following(abbreviated of course I'll write it up soon 
I promise):
assuming you have South installed
uninstall syncr from site-packages (don't remove it from your settings.py file)
svn co syncr into your pythonpath
run ./manage schemamigration flickr --initial --settings=DJANGO_SETTINGS_MODULE
run ./manage migrate flickr --fake --settings=DJANGO_SETTINGS_MODULE
make the changes you specified
changed flickr_id to models.BigIntegerField() (django supports bigintegerfields 
now with postgres)
run ./manage schemamigration flickr --auto --settings=DJANGO_SETTINGS_MODULE
run ./manage migrate flickr  --settings=DJANGO_SETTINGS_MODULE

Then call it good! :)

What this does is gives you a migration history, also it removes syncr from 
your site-packages as an egg and allows you to apply updates in the future with 
out having uninstall reinstall with sudo access (ugly)

anyway like I said I'll post an update on my blog for everyone in a little 
bit..(walking with the GF to the juice store now)

next on my list of todo is updating the twitter bit to use Oauth.... ugh!

Original comment by nick.l...@gmail.com on 5 Sep 2010 at 10:57

GoogleCodeExporter commented 9 years ago
Write up on what to do here: 
http://skooshmagoo.com/weblog/2010/sep/05/fixing-django-syncr-umedium-640/ If 
you have any questions lemme know

Original comment by nick.l...@gmail.com on 6 Sep 2010 at 1:02