Airtime 2.2.1: Uploaded MP3 file appears to be corrupted and will not be added to media library
  • Hi

    OS: Ubuntu server 11.10 64 bit
    Airtime 2.2.1 clean (without update) install from archive

    The trouble is concerned with mp3 file uploading. When we try to upload any mp3 file, this error appears. Files were uploaded to /tmp/plupload, but they are invisible in the library.

    You can see the technical information below:

    2013-01-14 01:22:53,814 INFO - [Thread-2] [replaygainupdater.py : run()] : LINE 69 - Runnning replaygain updater
    2013-01-14 01:22:54,287 INFO - [Thread-2] [api_client.py : get_files_without_replay_gain_value()] : LINE 695 - update file syst
    em mount: []
    2013-01-14 01:22:54,487 DEBUG - [Thread-2] [api_client.py : update_replay_gain_values()] : LINE 718 -
    2013-01-14 01:22:54,487 INFO - [Thread-2]
    [replaygainupdater.py : main()] : LINE 61 - Processed: 0 songs
    2013-01-14 01:27:54,580 INFO - [Thread-2] [replaygainupdater.py : run()] : LINE 69 - Runnning replaygain updater
    2013-01-14 01:27:55,033 INFO - [Thread-2] [api_client.py : get_files_without_replay_gain_value()] : LINE 695 - update file syst
    em mount: []
    2013-01-14 01:27:55,239 DEBUG - [Thread-2] [api_client.py : update_replay_gain_values()] : LINE 718 -
    2013-01-14 01:27:55,240

    INFO - [Thread-2] [replaygainupdater.py : main()] : LINE 61 - Processed: 0 songs
    media-monitor.log

    2013-01-14T01:19:30+04:00 INFO (6): [StoredFile.php : uploadFile() : line 832] - /usr/share/airtime/application/models/StoredFile.php:u
    ploadFile(): filename=p17gqsfht7rvp1anc1dti3i71ps87.mp3 to /tmp/plupload
    2013-01-14T01:19:38+04:00 INFO (6): [StoredFile.php : uploadFile() : line 832] -
    /usr/share/airtime/application/models/StoredFile.php:u
    ploadFile(): filename=p17gqsfht7rvp1anc1dti3i71ps87.mp3 to /tmp/plupload
    2013-01-14T01:19:39+04:00 INFO (6): [StoredFile.php : copyFileToStor() : line 925] - copyFileToStor: moving file /tmp/plupload/p17gqsfh
    t7rvp1anc1dti3i71ps87.mp3
    zendphp.log

    Locale is presented just in case:

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

    Thank you for your help!
    Post edited by Ruslan at 2013-01-14 07:58:12
  • 22 Comments sorted by
  • The problem appears to be related to nginx not setting the PATH variable, whereas apache does.

    setting PATH=/usr/local/bin:/usr/bin:/bin/usr/bin/ before running the liquidsoap commands resolves the issue. This fix will be included in 2.3.0 final.
    Airtime Pro Hosting: http://airtime.pro
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    Please try sudo service airtime-media-monitor restart
    Cloud Radio -> http://airtime.pro
  • yes, i rebooted service and then try reboot entire server, no result
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    Any file in /srv/airtime/stor/organize or problem_files?
    Cloud Radio -> http://airtime.pro
  • organize folder is empty, all off stor* dirs have 777 rights, and i can read/write ant files from user www-data (using by nginx and php-fpm)
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    look nginx log, your problem is here...
  • nginx error log are empty, in access log i fount my upload string:



    10.2.100.202 - - [14/Jan/2013:18:59:22 +0400] "POST /Plupload/upload/format/json HTTP/1.0" 200 73 "http://myradio.loc/Plupload" "Mozilla/5
    .0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0"
    10.2.100.202 - - [14/Jan/2013:18:59:22 +0400] "POST /Plupload/upload/format/json HTTP/1.0" 200 73 "http://myradio.loc/Plupload" "Mozilla/5
    .0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0"
    10.2.100.202 - - [14/Jan/2013:18:59:22 +0400] "GET /Plupload/copyfile/format/json/name/1.mp3/tempname/p17gsp4abl9n87n61ngs11f7d0u4.mp3?_=135817
    5548837 HTTP/1.0" 200 146 "http://myradio.loc/Plupload" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0"


    all of strings have 200 reply



  • anyone ? maybe dev. team can tell whats wrong with this error, i cant upload any mp3 file!
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    one more question :

    your airtime host is the same than nginx ?
  • yes it the same host (nginx, airtime, postgres etc), airtime installed from script airtime-2.2.1/install_full/ubuntu/airtime-full-install-nginx
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    Hey,
    Can you verify if liquidsoap is installed? Just run sudo airtime-check-system
    Cloud Radio -> http://airtime.pro
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    Hey, Ruslan,
     
    I can reproduce that problem. Ticket's filed, waiting for investigation. Thank you for your information.
    Post edited by Cliff Wang at 2013-01-14 18:16:09
    Cloud Radio -> http://airtime.pro
  • ok, btw,

    # airtime-check-system
    ...skipped...
    -- Your installation of Airtime looks OK!

    ps. you can roughly tell how long it will take time to fix that bug ?
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    Reply to @Ruslan:

    We've already addressed the problem, and want to fix it in 2.3. For now, you can use "airtime-import" command to import mp3 and other files as workaround.
    Cloud Radio -> http://airtime.pro
  • Airtime Pro Hosting: http://airtime.pro
  • Hello,

    I had the same issue on Ubuntu 12.04 LTS and Airtime 2.2.1 behind nginx.  PHP version is: PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli).

    After extensive tracing and debugging, the best I could come up with is that the PHP exec() in StoredFile.php in the method liquidsoapFilePlayabilityTest, is not returning the expected value even though the call to /usr/bin/airtime-liquidsoap line IS returning the correct value and completes successfully.

    So I patched StoredFile.php in the method liquidsoapFilePlayabilityTest as follows:
        public static function liquidsoapFilePlayabilityTest($audio_file)
    ...
            //exec($command, $output, $rv);  // comment this line out
            $output = shell_exec($command);  // add this line

            $isError = count($output) > 0 && in_array($output[0], $LIQUIDSOAP_ERRORS);

            //return ($rv == 0 && !$isError);      // comment this line out
            return ($output != NULL && !$isError); // add this line

    Hope this helps,
    -Bill
  • Hello,


    I had the same issue on Ubuntu 12.04 LTS and Airtime 2.2.1 behind nginx.  PHP version is: PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli).

    After extensive tracing and debugging, the best I could come up with is that the PHP exec() in StoredFile.php in the method liquidsoapFilePlayabilityTest, is not returning the expected value even though the call to /usr/bin/airtime-liquidsoap line IS returning the correct value and completes successfully.

    So I patched StoredFile.php in the method liquidsoapFilePlayabilityTest as follows:
        public static function liquidsoapFilePlayabilityTest($audio_file)
    ...
            //exec($command, $output, $rv);  // comment this line out
            $output = shell_exec($command);  // add this line

            $isError = count($output) > 0 && in_array($output[0], $LIQUIDSOAP_ERRORS);

            //return ($rv == 0 && !$isError);      // comment this line out
            return ($output != NULL && !$isError); // add this line

    Hope this helps,
    -Bill


    Hi BIll,

    I tried this out but without much success. The shell_exec command returns "Fatal error: exception Not_found" which is the same output string as exec. This was also run on Ubuntu 12.04.
    Airtime Pro Hosting: http://airtime.pro
  • Hello Martin, 


    It sounds in your case that the command being executed actually failed. In my case after running the command manually as the www-data user, it always completed successfully which pointed to the way the results were being interpreted. 


    After adding logging to the liquidsoapFilePlayabilityTest method, it became clear the $rv variable was not being set with the correct success value causing the method to incorrectly return false. In the first version of a fix I used for Airtime 2.2.0, I just modified the return to ignore the value of $rv.

    -Bill
  • Hello,

    The real difference between running php via nginx vs Apache is that Apache is normally configured to run php in-process whereas nginx is always configured to run php externally using the FastCGI Process Manager (php5-fpm) or equivalent.

    For instance, to change the PATH, it's just a matter of editing /etc/init.d/php5-fpm, updating PATH and then performing a service php5-fpm restart.  Also, php5-fpm has it's own log at /var/log/php5-fpm.log which would be worth checking.

    Since Apache also can run php externally the same way using php5-fpm, it would be worth seeing if configuring Apache that way will exhibit the same issue uploading files.  I suspect it will.

    It could be very helpful to update airtime-check-system.php to detect that liquidsoap can be executed successfully 1) it's in the PATH and 2) it's returning the correct exit status by using similar logic as the liquidsoapFilePlayabilityTest method but without attempting to actually test an audio file.

    Are there any other places in the Airtime codebase that exec airtime-liquidsoap?  If so, do they still work under php5-fpm?

    -Bill
  • Hello Martin,
    Ticket available here:

    The ticket indicates this issue is fixed in 2.3.0.  How was it fixed and/or what commit included the fix?  

    Thanks,
    -Bill
  • Hello Martin,

    Ticket available here:

    The ticket indicates this issue is fixed in 2.3.0.  How was it fixed and/or what commit included the fix?  

    Thanks,
    -Bill


    I eventually found what looks to be the fix at https://github.com/sourcefabric/Airtime/commit/c39b99da6cb5d39e55c5074358d67bf767421c9f.

    Looking forward to upgrading to Airtime 2.3.0 soon.

    -Bill
  • Hi Bill,

    As you probably noticed, 2.3.0 is now out, let us know how the fix works for you.

    Airtime Pro Hosting: http://airtime.pro