MoH:MP3 upload - Cannot write to file () ... Error

Discussion in 'General' started by zaleo, Aug 10, 2010.

  1. zaleo

    Joined:
    Aug 9, 2010
    Messages:
    2
    Likes Received:
    0
    Dear all,

    First of all, congratulations on the Elastix 2.0 release!

    I am fighting this issue for day's now. Hoping someone can help me out.
    When I try to upload an MP3 for my own MoH or when I try to create a new music category I receive the message "Cannot write to file ()".

    To solve this issue I played around with a lot of the settings. For example I installed lame as I was thinking it could not convert the mp'3.
    Changed /etc/php.ini to make sure the post and max filesize was not set to low.
    Changed a lot in my musiconhold_additional.conf (looking at my old 1.6 installation).
    Changed permissions and ownership of the moh and mohmp3 folder.

    Finally I found some error log's, I was looking in Astrisk and FreePBX, but found them in httpd eventually.

    Version : Elastix 2.0.0-32

    musiconhold_additional.conf
    Code:
    [default]
    mode=files
    directory=/var/lib/asterisk/mohmp3/
    [none]
    mode=files
    directory=/dev/null
    httpd:ssh_error.log

    Code:
    [Mon Aug 09 23:15:04 2010] [error] [client home.IP.address] PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/admin/functions.inc.php on line 777, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    [Mon Aug 09 23:15:04 2010] [error] [client home.IP.address] PHP Notice:  Undefined variable: skip_astman in /var/www/html/admin/header.php on line 117, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    [Mon Aug 09 23:15:04 2010] [error] [client home.IP.address] PHP Warning:  mkdir() [<a href='function.mkdir'>function.mkdir</a>]: No such file or directory in /var/www/html/admin/modules/music/page.music.php on line 160, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    [Mon Aug 09 23:15:04 2010] [error] [client home.IP.address] PHP Warning:  mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied in /var/www/html/admin/modules/music/page.music.php on line 160, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    [Mon Aug 09 23:15:04 2010] [error] [client home.IP.address] PHP Warning:  touch() [<a href='function.touch'>function.touch</a>]: Unable to create file /.nomusic_reserved/silence.wav because No such file or directory in /var/www/html/admin/modules/music/page.music.php on line 122, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    [Mon Aug 09 23:15:04 2010] [error] [client home.IP.address] PHP Warning:  fopen(/etc/asterisk\r/musiconhold_additional.conf) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in /var/www/html/admin/modules/music/page.music.php on line 140, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    [Mon Aug 09 23:15:04 2010] [error] [client home.IP.address] PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /var/www/html/admin/modules/music/page.music.php on line 142, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    [Mon Aug 09 23:15:04 2010] [error] [client home.IP.address] PHP Notice:  Undefined variable: tmpfname in /var/www/html/admin/modules/music/page.music.php on line 143, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    [Mon Aug 09 23:15:06 2010] [error] [client home.IP.address] PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/admin/functions.inc.php on line 777, referer: https://sip.mydomain.xx/?menu=pbxconfig&display=music
    [Mon Aug 09 23:15:06 2010] [error] [client home.IP.address] PHP Notice:  Undefined variable: skip_astman in /var/www/html/admin/header.php on line 117, referer: https://sip.mydomain.xx/?menu=pbxconfig&display=music
    [Mon Aug 09 23:15:06 2010] [error] [client home.IP.address] PHP Notice:  Undefined variable: htmlFPBX in /var/www/html/modules/pbxadmin/index.php on line 502, referer: https://sip.mydomain.xx/?menu=pbxconfig&display=music
    [Mon Aug 09 23:15:06 2010] [error] [client home.IP.address] File does not exist: /var/www/html/modules/pbxadmin/js/script.legacy.js, referer: https://sip.mydomain.xx/config.php?display=music&action=add
    URL and IP's have been replaced (I hope)

    I find the \r in the path very strange, but maybe this is an intended line-feed in the log?

    All Advice is appreciated!

    Kind Regards, Zaleo.
     
  2. dingoland

    Joined:
    Jan 16, 2008
    Messages:
    220
    Likes Received:
    0
    Hi,

    I got the problem today on my elastix box 1.6.
    It should be the same solution : install mpg123 rpm from sunet ftp.

    Have a look at elastixconnection, the post is in the top 10 of the homepage site.

    Regards
     
  3. zaleo

    Joined:
    Aug 9, 2010
    Messages:
    2
    Likes Received:
    0
    I now installer mpeg123..

    The issue however is not solved...

    I point out this errror:
    Code:
     opendir(/var/lib/asterisk[b]\r[/b]/mohmp3) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: No such file or directory in /var/www/html/admin/modules/music/page.music.php on line 166
    I guess the \r (line feed) should not be there !
    Maybe I am completely wrong, but where (What config file?) is that path defined?
     
  4. Terry

    Joined:
    May 25, 2007
    Messages:
    174
    Likes Received:
    0
    Dear All,

    I am test with Elastix 2.0.2

    the same situation happend.

    How to do now
     
  5. dingoland

    Joined:
    Jan 16, 2008
    Messages:
    220
    Likes Received:
    0
    Hi Terry,

    You have to install mpg123 on your elastix server.

    Search in the forum or read in the elastix without tears book the version of the mpg123 to install (this version works fine).

    Regards
     

Share This Page