• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Kernel Update fails ... Oh no, not again!

Scheduled Pinned Locked Moved Solved
FOG Problems
5
29
8.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    sudburr
    last edited by sudburr Jan 30, 2018, 11:25 AM Jan 30, 2018, 4:57 PM

    Server: CentOS 7.4
    FOG: 1.4.4

    Ye olde error when updating kernel. (currently 4.11.0)

    Type: 2, File: /var/www/html/fog/lib/fog/fogftp.class.php, Line: 707, Message: ftp_put(): Could not create file., Host: 172.22.48.14, Username: fog
    

    I have referred to Troubleshoot FTP and followed all steps.

    I have updated the OS and re-installed FOG as well but to no avail.

    From /var/log/httpd/error_log

    PHP Fatal error:  Uncaught Error: Call to a member function lastInsertId() on boolean in /var/www/html/fog/lib/db/pdodb.class.php:443\nStack trace:\n#0 /var/www/html/fog/lib/fog/fogcontroller.class.php(527): PDODB->insertId()\n#1 /var/www/html/fog/lib/fog/hookmanager.class.php(59): FOGController->save()\n#2 /var/www/html/fog/lib/fog/fogpagemanager.class.php(82): HookManager->processEvent('SEARCH_PAGES', Array)\n#3 [internal function]: FOGPageManager->__construct()\n#4 /var/www/html/fog/lib/fog/fogbase.class.php(457): ReflectionClass->newInstanceArgs(Array)\n#5 /var/www/html/fog/management/index.php(23): FOGBase::getClass('FOGPageManager')\n#6 {main}\n  thrown in /var/www/html/fog/lib/db/pdodb.class.php on line 443, referer: http://xyzfog/fog/management/index.php?node=home
    
    AH00170: caught SIGWINCH, shutting down gracefully
    
    PHP Warning:  ftp_mkdir(): Create directory operation failed. in /var/www/html/fog/lib/fog/fogftp.class.php on line 492, referer: http://xyzfog/fog/management/index.php?node=about&sub=kernel&file=aHR0cHM6Ly9mb2dwcm9qZWN0Lm9yZy9rZXJuZWxzL0tlcm5lbC5Ub21FbGxpb3R0LjQuMTMuNC42NA==&arch=64
    
    PHP Warning:  ftp_rename(): RNFR command failed. in /var/www/html/fog/lib/fog/fogftp.class.php on line 769, referer: http://xyzfog/fog/management/index.php?node=about&sub=kernel&file=aHR0cHM6Ly9mb2dwcm9qZWN0Lm9yZy9rZXJuZWxzL0tlcm5lbC5Ub21FbGxpb3R0LjQuMTMuNC42NA==&arch=64
    
    PHP Warning:  ftp_put(): Could not create file. in /var/www/html/fog/lib/fog/fogftp.class.php on line 707, referer: http://xyzfog/fog/management/index.php?node=about&sub=kernel&file=aHR0cHM6Ly9mb2dwcm9qZWN0Lm9yZy9rZXJuZWxzL0tlcm5lbC5Ub21FbGxpb3R0LjQuMTMuNC42NA==&arch=64
    

    [ Standing in between extinction in the cold and explosive radiating growth ]

    G 1 Reply Last reply Jan 30, 2018, 5:03 PM Reply Quote 0
    • G
      george1421 Moderator @sudburr
      last edited by Jan 30, 2018, 5:03 PM

      @sudburr Does the linux user fog have write permissions to /var/ww/html/fog/service/ipxe and all files under?

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      1 Reply Last reply Reply Quote 1
      • S
        sudburr
        last edited by Jan 30, 2018, 5:25 PM

        Would you please type out the exact commands you want to be tried?

        [ Standing in between extinction in the cold and explosive radiating growth ]

        G 1 Reply Last reply Jan 30, 2018, 5:42 PM Reply Quote 0
        • G
          george1421 Moderator @sudburr
          last edited by Jan 30, 2018, 5:42 PM

          @sudburr lets start out with

          ls -la /var/www/html/fog/service/ipxe

          bzImage needs to be owned by fog or have world write access.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          S 1 Reply Last reply Jan 31, 2018, 5:22 PM Reply Quote 1
          • S
            Sebastian Roth Moderator
            last edited by Jan 30, 2018, 7:56 PM

            @sudburr said in Kernel Update fails ... Oh no, not again!:

            PHP Fatal error: Uncaught Error: Call to a member function lastInsertId…

            To me this sounds as if there is an issue with the database credentials as well.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            1 Reply Last reply Reply Quote 1
            • S
              sudburr
              last edited by Jan 31, 2018, 4:19 PM

              Heh… I’ve lost contact with both servers displaying this problem. 😎

              [ Standing in between extinction in the cold and explosive radiating growth ]

              1 Reply Last reply Reply Quote 0
              • S
                sudburr @george1421
                last edited by Jan 31, 2018, 5:22 PM

                @george1421 said in Kernel Update fails ... Oh no, not again!:

                ls -la /var/www/html/fog/service/ipxe

                results:

                drwxr-xr-x. 2 fog    apache     4096 Jan 30 11:13 .
                drwxr-xr-x. 3 apache apache     4096 Jan 30 11:13 ..
                -rw-r--r--. 1 fog    apache     1966 Jan 30 11:13 advanced.php
                -rw-r--r--. 1 fog    apache    16272 Jan 30 11:13 bgdark.png
                -rw-r--r--. 1 fog    apache    21280 Jan 30 11:13 bg.png
                -rw-r--r--. 1 fog    apache      922 Jan 30 11:13 boot.php
                -rw-r--r--. 1 fog    apache  7601536 Jan 30 11:13 bzImage
                -rw-r--r--. 1 fog    apache  7465280 Jan 30 11:13 bzImage32
                -rw-r--r--. 1 fog    apache   234697 Jan 30 11:13 grub.exe
                -rw-r--r--. 1 fog    apache      592 Jan 30 11:13 index.php
                -rw-r--r--. 1 fog    apache 18646084 Jan 30 11:13 init_32.xz
                -rw-r--r--. 1 fog    apache 19605632 Jan 30 11:13 init.xz
                -rw-r--r--. 1 fog    apache    25340 Jan 30 11:13 memdisk
                -rw-r--r--. 1 fog    apache  1839104 Jan 30 11:13 memtest.bin
                -rw-r--r--. 1 fog    apache    20976 Jan 30 11:13 refind.conf
                -rw-r--r--. 1 fog    apache   205192 Jan 30 11:13 refind.efi
                

                [ Standing in between extinction in the cold and explosive radiating growth ]

                1 Reply Last reply Reply Quote 0
                • J
                  jstephen
                  last edited by Feb 2, 2018, 7:34 PM

                  I’m having the exact same trouble. I’ve also worked through all of the steps in Troubleshoot FTP, and I also updated Fog today and applied all updates to the server OS (Debian Jesse with kernel 3.16.51-3).

                  I noticed the problem updating the kernel from the web interface where I get these errors:
                  Warning: ftp_mkdir(): Create directory operation failed. in /var/www/html/fog/lib/fog/fogftp.class.php on line 492

                  Warning: ftp_rename(): Rename failed. in /var/www/html/fog/lib/fog/fogftp.class.php on line 769
                  ##OK##

                  All of my permissions look fine - fog has access to everything it needs to as far as I can tell! - and the password for the fog account is the same in all locations.

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sebastian Roth Moderator
                    last edited by Feb 2, 2018, 8:14 PM

                    @jstephen Which version of FOG do you use?

                    @sudburr Sorry for not getting back yet. Just couldn’t get to a conclusion or find a good answer. Maybe it’s a SElinux issue in your case? Have you got that disabled? Running the command getenforce shows what on your FOG server?

                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                    J G S 3 Replies Last reply Feb 2, 2018, 8:42 PM Reply Quote 0
                    • J
                      jstephen @Sebastian Roth
                      last edited by Feb 2, 2018, 8:42 PM

                      @sebastian-roth I’ve gotten the same thing on 1.4.2, 1.4.4 and now on 1.5.0-RC-11

                      1 Reply Last reply Reply Quote 0
                      • G
                        george1421 Moderator @Sebastian Roth
                        last edited by Feb 2, 2018, 9:34 PM

                        @sebastian-roth FWIW I did get the same thing on my product server 1.4.4, in my case I attributed it to my fog server not having direct internet access. Then I did some stuff and it downloaded a 0 byte file for bzImage so I just updated it by hand. I did ensure that the linux user fog had access to the ipxe directory. I was going to play a bit this weekend to see if I could figure something else.

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sebastian Roth Moderator
                          last edited by Feb 3, 2018, 7:48 AM

                          @jstephen @george1421 @sudburr Can you all please try the following by hand:

                          shell> sudo cp /var/www/fog/service/ipxe/bzImage /var/www/fog/service/ipxe/testfile
                          shell> sudo chown fog:apache /var/www/fog/service/ipxe/testfile
                          shell> sudo chmod 644 var/www/fog/service/ipxe/testfile
                          shell> sudo apt-get install ftp
                          shell> ftp
                          ftp> open 127.0.0.1
                          Connected to 127.0.0.1.
                          220 (vsFTPd 3.0.3)
                          Name (127.0.0.1:roth): fog
                          331 Please specify the password.
                          Password:
                          230 Login successful.
                          Remote system type is UNIX.
                          Using binary mode to transfer files.
                          ftp> pwd
                          257 "/home/fog" is the current directory
                          ftp> mkdir /var/www/fog/service/ipxe/backup
                          257 "/var/www/fog/service/ipxe/backup" created
                          ftp> rename /var/www/fog/service/ipxe/testfile /var/www/fog/service/ipxe/backup/testfile
                          350 Ready for RNTO.
                          250 Rename successful.
                          ftp> quit
                          

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          G S J 3 Replies Last reply Feb 3, 2018, 1:14 PM Reply Quote 0
                          • G
                            george1421 Moderator @Sebastian Roth
                            last edited by george1421 Feb 3, 2018, 7:51 AM Feb 3, 2018, 1:14 PM

                            @sebastian-roth

                            Auto update via fog-gui works on FOG-Pi server (raspbian) that has direct internet access.

                            Production fog server does not work even after making sure directory permissions are set. bzImage created by zero bytes.
                            0_1517663625380_fog-ipxe.png
                            The create directory failed when executing on production server. The backup directory already existed. Peeking inside it has content.
                            0_1517664250293_ipxe-backup.png

                            reviewing the apache error log netted this info.

                            [Sat Feb 03 08:28:25.466950 2018] [:error] [pid 21617:tid 139862824957696] [client 10.96.151.50:62795] PHP Warning:  ftp_mkdir(): Create directory operation failed. in /var/www/html/fog/lib/fog/fogftp.class.php on line 492, referer: http://192.168.1.53/fog/management/index.php?node=about&sub=kernel&file=aHR0cHM6Ly9mb2dwcm9qZWN0Lm9yZy9rZXJuZWxzL0tlcm5lbC5Ub21FbGxpb3R0LjQuMTMuNC42NA==&arch=64
                            [Sat Feb 03 08:28:25.475420 2018] [:error] [pid 21617:tid 139862824957696] [client 10.96.151.50:62795] PHP Warning:  ftp_rename(): RNFR command failed. in /var/www/html/fog/lib/fog/fogftp.class.php on line 769, referer: http://192.168.1.53/fog/management/index.php?node=about&sub=kernel&file=aHR0cHM6Ly9mb2dwcm9qZWN0Lm9yZy9rZXJuZWxzL0tlcm5lbC5Ub21FbGxpb3R0LjQuMTMuNC42NA==&arch=64
                            

                            The backup directory now contains

                            -rwxr-xr-x 1 fog fog    0 Feb  3 08:10 bzImage_20180203_082824
                            

                            The ipxe directory now contains

                            -rwxr-xr-x 1 fog  fog         0 Feb  3 08:28 bzImage
                            

                            Now may issue may be that the production fog server doesn’t have direct internet access but must pass through a proxy server.

                            Observations executing the script.

                            1. Of course kernel updates on raspbian.
                            2. On raspbian the ower of the file is fog:www-data not fog:apache that may cause problems for others executing the script based on the FOG server’s OS.
                            3. On raspbian /var/www/fog/service/ipxe is correct on centos the correct path is /var/www/html/fog/service/ipxe.
                            4. With corrections the script executed correctly on both raspbian and centos.

                            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                            1 Reply Last reply Reply Quote 0
                            • S
                              Sebastian Roth Moderator
                              last edited by Sebastian Roth Feb 3, 2018, 9:18 AM Feb 3, 2018, 3:17 PM

                              @george1421 said in Kernel Update fails ... Oh no, not again!:

                              Now may issue may be that the production fog server doesn’t have direct internet access but must pass through a proxy server.

                              But the code should actually use proxy settings made in the web UI (code ref) so I am wondering what goes wrong here as it does not seem to return 4xx HTTP code and therefore the kernel update page does not notice something went wrong. Do you have access to the proxy logs?

                              On the other hand I wondered about the zero bytes file size as there is a check in the code. Unfortunately there was an issue with the file size check which I just fixed in the current working branch (ref).

                              ... ftp_mkdir(): Create directory operation failed...

                              As well I wonder about why you all see this. There is a check before mkdir that should prevent from trying so if the directory already exists. From my point of view that should work correctly.

                              On raspbian /var/www/fog/service/ipxe is correct on centos the correct path is /var/www/html/fog/service/ipxe.

                              Thanks for pointing that out. I should have made my test commands not specific to debian/ubuntu without mentioning.

                              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                              1 Reply Last reply Reply Quote 0
                              • S
                                sudburr @Sebastian Roth
                                last edited by Feb 6, 2018, 4:34 PM

                                @sebastian-roth sestatus results

                                SELinux status:                 enabled
                                SELinuxfs mount:                /sys/fs/selinux
                                SELinux root directory:         /etc/selinux
                                Loaded policy name:             targeted
                                Current mode:                   permissive
                                Mode from config file:          permissive
                                Policy MLS status:              enabled
                                Policy deny_unknown status:     allowed
                                Max kernel policy version:      28
                                

                                This is the same as on all of our other fog servers.

                                [ Standing in between extinction in the cold and explosive radiating growth ]

                                G 1 Reply Last reply Feb 6, 2018, 4:42 PM Reply Quote 0
                                • S
                                  sudburr @Sebastian Roth
                                  last edited by Feb 6, 2018, 4:42 PM

                                  @sebastian-roth said in Kernel Update fails ... Oh no, not again!:

                                  rename /var/www/fog/service/ipxe/testfile /var/www/fog/service/ipxe/backup/testfile

                                  Completed the ftp steps detailed and update via GUI continues to fail.

                                  [ Standing in between extinction in the cold and explosive radiating growth ]

                                  1 Reply Last reply Reply Quote 0
                                  • G
                                    george1421 Moderator @sudburr
                                    last edited by george1421 Feb 6, 2018, 10:43 AM Feb 6, 2018, 4:42 PM

                                    @sudburr if selinux is enabled, then you will have issues capturing images for sure. You need to configure selinux to permissive. On centos its in /etc/selinux and there is a config file in there you need to edit so it says permissive. Then reboot your FOG server.

                                    # This file controls the state of SELinux on the system.
                                    # SELINUX= can take one of these three values:
                                    #     enforcing - SELinux security policy is enforced.
                                    #     permissive - SELinux prints warnings instead of enforcing.
                                    #     disabled - No SELinux policy is loaded.
                                    SELINUX=permissive
                                    # SELINUXTYPE= can take one of three two values:
                                    #     targeted - Targeted processes are protected,
                                    #     minimum - Modification of targeted policy. Only selected processes are protected.
                                    #     mls - Multi Level Security protection.
                                    SELINUXTYPE=targeted
                                    

                                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      sudburr
                                      last edited by Feb 6, 2018, 4:46 PM

                                      SELinux is already configured and functions properly for all servers. Imaging is not the problem. The problem is updating the kernel on 2 of 18 physical servers.

                                      [ Standing in between extinction in the cold and explosive radiating growth ]

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        jstephen @Sebastian Roth
                                        last edited by Feb 6, 2018, 6:12 PM

                                        @sebastian-roth Following your steps, I get this:

                                        ftp> mkdir /var/www/fog/service/ipxe/backup
                                        550 Create directory operation failed.

                                        It seems that I am able to rename the files though.

                                        I also notice that all of the other files in the ipxe folder are owned by fog:www-data; however, the files the Fog is trying to create for the new kernel are owned by fog:fog. Could this be part of the problem?

                                        One more observation: the fog GUI is reporting that the operation failed to ftp_mkdir and ftp_rename, however the file exists in the ipxe directory and has 8069680 bytes which is probably about right, right? Is the file being copied elsewhere also and failing there? Or, is the GUI error… in error?

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          Sebastian Roth Moderator
                                          last edited by Feb 6, 2018, 9:54 PM

                                          @sudburr said in Kernel Update fails ... Oh no, not again!:

                                          Completed the ftp steps detailed and update via GUI continues to fail.

                                          Can you please post a listing or picture of the commands and output?

                                          @jstephen said:

                                          ftp> mkdir /var/www/fog/service/ipxe/backup
                                          550 Create directory operation failed.

                                          This might be due to the fact that the directory already exists. See with ls -al /var/www/fog/service/ipxe on the command line.

                                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                          S 1 Reply Last reply Feb 7, 2018, 1:15 AM Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          1 / 2
                                          • First post
                                            3/29
                                            Last post

                                          212

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project