Issue Details (XML | Word | Printable)

Key: FLM-24
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Adam Zieliński
Reporter: Borys Musielak
Votes: 0
Watchers: 0
Operations

Clone this issue
Create sub-task
If you were logged in you would be able to see more operations.
Filmaster

ProgrammingError: value too long for type character varying(128) in imdb fetcher

Created: 02/Apr/09 12:37 PM   Updated: 19/Apr/09 02:32 PM
Component/s: Fetchers
Affects Version/s: 1.0
Fix Version/s: 1.0

Time Tracking:
Not Specified


 Description  « Hide
This error is flooding the mailbox:

Traceback (most recent call last):
  File "/home/filmaster/film20/fetcher/imdb_fetcher.py", line 570, in <module> main()
  File "/home/filmaster/film20/fetcher/imdb_fetcher.py", line 567, in main
    run(pickle, unpickle, list, single_movie, idlist, cron_job, conntype, single_movie_title)
  File "/home/filmaster/film20/fetcher/imdb_fetcher.py", line 511, in run
    saved_movie = save_movie_to_db(movie)
  File "/usr/lib/python2.5/site-packages/django/db/transaction.py", line 238, in _commit_on_success
    res = func(*args, **kw)
  File "/home/filmaster/film20/fetcher/imdb_fetcher.py", line 439, in save_movie_to_db
    saved_film = save_movie(movie, movie_link)
  File "/home/filmaster/film20/fetcher/imdb_fetcher.py", line 384, in save_movie
    save_countries(countries, film)
  File "/home/filmaster/film20/fetcher/imdb_fetcher.py", line 264, in save_countries
    film.save_localized_title(localized_title, country_code, saved_by=2)
  File "/home/filmaster/film20/film20/core/models.py", line 477, in save_localized_title
    self.film_localized.save()
  File "/home/filmaster/film20/film20/core/models.py", line 667, in save
    super(FilmLocalized, self).save() File "/home/filmaster/film20/film20/core/models.py", line 575, in save
    super(ObjectLocalized, self).save()
  File "/usr/lib/python2.5/site-packages/django/db/models/base.py", line 307, in save
    self.save_base(force_insert=force_insert, force_update=force_update)
  File "/usr/lib/python2.5/site-packages/django/db/models/base.py", line 358, in save_base rows = manager.filter(pk=pk_val)._update(values)
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line 429, in _update
    return query.execute_sql(None)
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/subqueries.py", line 117, in execute_sql
    cursor = super(UpdateQuery, self).execute_sql(result_type)
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/query.py", line 1700, in execute_sql
    cursor.execute(sql, params)
psycopg2.ProgrammingError: value too long for type character varying(128)

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Adam Zieliński added a comment - 03/Apr/09 09:32 PM
done!

Borys Musielak added a comment - 03/Apr/09 11:19 PM
What exactly has been done? And is it fixed in prod?

Adam Zieliński added a comment - 05/Apr/09 10:40 PM
Yes it is fixed on production. Fetcher crashed because it was trying to save localized title longer than 128 chars, now it checks localized title lenght and cuts it when necessary.

Borys Musielak added a comment - 14/Apr/09 03:17 PM
Failing on prod again. I removed the task from the cronjob. Please fix and them uncomment the line:
#*/10 * * * * python /home/filmaster/film20/fetcher/imdb_fetcher.py -f
in crontab

Borys Musielak added a comment - 19/Apr/09 02:32 PM
OK I resolved it myself as the users were already getting annoyed with not-working imports. It truncates all titles to 128 characters if the title is longer than that.

Also, aditional logging has been added to tell which movies were imported, which were not and if so, what was the reason for the latter (all will be sent via e-mails)