update database media is failed
  • hello,
    I am facing an issue, I can not update my media database. The script airtime-import just copy the mp3 files on /srv/airtime/orgonize but nothing else happens

    Here are last line of the file : /var/log/airtime/media-monitor/media-monitor.log
    ########################
    2012-07-13 16:48:14,480 ERROR - [MainThread] [media_monitor.py : <module>()] : LINE 144 - traceback: Traceback (most recent call last):
      File "/usr/lib/airtime/media-monitor/media_monitor.py", line 128, in <module>
        wdd = notifier.watch_directory(storage_directory)
      File "/usr/lib/airtime/media-monitor/airtimefilemonitor/airtimenotifier.py", line 194, in watch_directory
        return self.wm.add_watch(directory, self.mask, rec=True, auto_add=True)
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/pyinotify.py", line 1887, in add_watch
        for rpath in self.__walk_rec(apath, rec):
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/pyinotify.py", line 2075, in __walk_rec
        for root, dirs, files in os.walk(top):
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/os.py", line 294, in walk
        for x in walk(path, topdown, onerror, followlinks):
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/os.py", line 284, in walk
        if isdir(join(top, name)):
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/posixpath.py", line 70, in join
        path += '/' + b
      File "/usr/lib/airtime/airtime_virtualenv/lib/python2.6/encodings/utf_8.py", line 16, in decode
        return codecs.utf_8_decode(input, errors, True)
    UnicodeDecodeError: 'utf8' codec can't decode byte 0xeb in position 6: invalid continuation byte
    ############################

    Thanks in advance for your help.
    DS
  • 5 Comments sorted by
  • Hello,

    We've had similar issue's before it appears to only happen with python 2.6 and one of our Python libraries.


    One of our users (Albert FR) discovered it seems to happen with files that have a strange Unicode characters. I haven't seen this issue on Pytohn 2.7, so I would recommend upgrading to that version or simply finding the file with the invalid character in its file name.
    Airtime Pro Hosting: http://airtime.pro
  • hello,

    I have purge my database, now I cannot add a new mp3 file.

    Here are my locale setting

    LANG=fr_FR.UTF-8
    LANGUAGE=
    LC_CTYPE="fr_FR.UTF-8"
    LC_NUMERIC="fr_FR.UTF-8"
    LC_TIME="fr_FR.UTF-8"
    LC_COLLATE="fr_FR.UTF-8"
    LC_MONETARY="fr_FR.UTF-8"
    LC_MESSAGES="fr_FR.UTF-8"
    LC_PAPER="fr_FR.UTF-8"
    LC_NAME="fr_FR.UTF-8"
    LC_ADDRESS="fr_FR.UTF-8"
    LC_TELEPHONE="fr_FR.UTF-8"
    LC_MEASUREMENT="fr_FR.UTF-8"
    LC_IDENTIFICATION="fr_FR.UTF-8"
    LC_ALL=

    I still have this error : UnicodeDecodeError: 'utf8' codec can't decode byte 0xeb in position 6: invalid continuation byte

    Thanks in advance.

    DS

  • Hi, 

    I don't think purging the database is the problem for you. I think you have a file encoded in latin-1/ISO-8859-1 on your system, and Python is trying to decode it as UTF-8 which causes problems.

    You can attempt to fix this by running

    convmv --notest -r -f iso-8859-1 -t utf8 /path/to/your/music

    (take out the --notest parameter if you want to do a "test" of what files will be changed first)
    Airtime Pro Hosting: http://airtime.pro
  • Hi,

    Thanks for this suggestion but it doesn't work (I was already test with the tool iconv, and same result)

    "UnicodeDecodeError: 'utf8' codec can't decode byte 0xeb in position 6: invalid continuation byte"

    But currently my media base is empty and no file can be imported.

    How can i know the file encoding ? When I use the the tool "file", I got this :

    #file -i "02 - You Are.mp3"
    02 - You Are.mp3: audio/mpeg; charset=binary

    # file  "02 - You Are.mp3"
    02 - You Are.mp3: Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v1, 320 kbps, 44.1 kHz, Stereo


  • Hi,

    The issue is fixed, the real problem was that my files were in ISO-8859-1 instead of unicode.

    Martin suggested me to run "sudo convmv --no-test -r -f iso8859-1 -t utf8 /srv/airtime/stor".

    Now everything is ok. Thanks Martin for his precious help.

    DS