Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Advanced troubleshooting Missing pandora_console directory during update

  • Missing pandora_console directory during update

    Posted by Cursorkeys on January 10, 2017 at 21:01

    Version: 6.0SP4 (P) 170102
    Platform: CentOS

    The last two times I’ve tried to use the Online update I’ve received “Failed to copy files”.

    Fixing it requires:

    cd /var/www/html/pandora_console/attachment/downloads
    mkdir pandora_console
    chown apache pandora_console

    As soon as the update succeeds the folder is deleted again. Is the deletion abnormal or is the issue that the folder isn’t being created at the start of the update attempt?

    Many thanks,

    Jon

    Cursorkeys replied 7 years, 11 months ago 4 Members · 9 Replies
  • 9 Replies
  • antonio

    Member
    January 12, 2017 at 20:02
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello Cursorkeys,

    I think the issue is the folder isn’t being created at the start of the update, because when the update ends it should be deleted. Can it be caused by an incorrect permissions of the upper level folder?

    Kind regards,
    Antonio.

  • Cursorkeys

    Member
    January 13, 2017 at 16:19
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi Antonio,

    Thanks a lot for the information. The downloads folder was 755, user and group was apache. I’ve changed it to 777 and we’ll see what happens next week!

    Many thanks,

    Jon

  • XyVy

    Member
    January 23, 2017 at 23:27
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    I have other version, 6.0 SP3 but I have the same problem.

    I have put 777 permissions to download folder but it happens the same.

    any sugestion?

  • XyVy

    Member
    January 25, 2017 at 16:25
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Finaly, I have done a fresh install 6.0SP4 161104, but it has the same problem.

    I believe there is a bug in functions_update_manager.php file, after review the function update_manager_starting_update() I see two problems:

    If you obtain the error “Failed to copy files”  the problem is that the 611 line says:

    $full_path = $config['attachment_store'] . "/downloads/pandora_console";

    And it must say:

    $full_path = $config['attachment_store'] . "/downloads/unix";

    Because the last_package.tgz is extracted to the “unix” folder not in “pandora_console” how the script php is awaiting.

    If you obtain the error “fail to extract files” the problem is the 649 line, because where it says:

    if ($result != 0) {

    it should say:

    if ($result != true) {

    Because $result is the returned value from the function extractTo when it extracts the lastpackage.tgz

    In sp3, the problem was only the copying files, but in my version 6.0SP4 161104 I had the two problems, but I have changed the files according I have explained above and the update process was ended correctly, and now I have 170116 version installed and the update manager says me there is no updates available.

  • gairhald

    Member
    January 27, 2017 at 14:18
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Finaly, I have done a fresh install 6.0SP4 161104, but it has the same problem.

    I believe there is a bug in functions_update_manager.php file, after review the function update_manager_starting_update() I see two problems:

    If you obtain the error “Failed to copy files”  the problem is that the 611 line says:

    $full_path = $config['attachment_store'] . "/downloads/pandora_console";

    And it must say:

    $full_path = $config['attachment_store'] . "/downloads/unix";

    Because the last_package.tgz is extracted to the “unix” folder not in “pandora_console” how the script php is awaiting.

    If you obtain the error “fail to extract files” the problem is the 649 line, because where it says:

    if ($result != 0) {

    it should say:

    if ($result != true) {

    Because $result is the returned value from the function extractTo when it extracts the lastpackage.tgz

    In sp3, the problem was only the copying files, but in my version 6.0SP4 161104 I had the two problems, but I have changed the files according I have explained above and the update process was ended correctly, and now I have 170116 version installed and the update manager says me there is no updates available.

    Thanks for the info!

  • antonio

    Member
    January 30, 2017 at 13:33
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello everyone,

    Thanks for posting, I’ve told the development team about the issues found by XyVy and we’re going to apply the changes to the following versions so this issue with the update manager gets 100% resolved.
    Thanks for all the info!

    Kind regards,
    Antonio.

  • XyVy

    Member
    February 2, 2017 at 03:05
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Thanks Antonio.s

    I believe that there is other bug in the last update 170130, I have SP4 170116 when I try to update to 170130 the update manager says: There is a unknown error.

    The pandora_console logs shows:

    [01-Feb-2017 23:56:53 Europe/Madrid] PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'unable to decompress gzipped phar archive "/var/www/pandora_console/attachment/downloads/last_package.tgz" to temporary file' in /var/www/pandora_console/include/functions_update_manager.php:624
    Stack trace:
    #0 /var/www/pandora_console/include/functions_update_manager.php(624): PharData->__construct('/var/www/pandor...')
    #1 /var/www/pandora_console/include/ajax/update_manager.ajax.php(488): update_manager_starting_update()
    #2 /var/www/pandora_console/ajax.php(86): require_once('/var/www/pandor...')
    #3 {main}
      thrown in /var/www/pandora_console/include/functions_update_manager.php on line 624
    

    I have seen the last_package.tgz is downloaded, but there is a problem to decompress the file.
    If I open a shell to do a tar -zxvf last_package.tgz the procces ends with:

    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    

    I believe that the last_package.tgz corresponding to 170130 version is corrupted. The Pandora team has tested the last_package.tgz (170130) integrity?

    Thanks

  • XyVy

    Member
    February 8, 2017 at 19:56
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    The 170206 update has the same error, the last_package is corrupt.

  • Cursorkeys

    Member
    February 15, 2017 at 20:09
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    As an update for what I did in the end: I fixed this by creating a dot-file owned by root in /var/www/html/pandora_console/attachment/downloads/pandora_console.

    As the update script doesn’t have root permissions it can’t remove that file to delete the directory so everything continues working. Not elegant but a solution nonetheless!