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

RecursiveDirectoryIterator preventing snapin uploads

Scheduled Pinned Locked Moved
FOG Problems
2
6
826
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.
  • A
    altitudehack
    last edited by Mar 19, 2021, 8:39 PM

    I was creating a snapin and it uploaded fine. It didn’t work for an unrelated reason, so I made a change, deleted the snapin and tried to re-upload it and keep getting this error in the notification pop-up:

    RecursiveDirectoryIterator::__construct(//boot/grub2): failed to open dir: Permission denied
    

    SELinux is in permissive mode. I don’t see anything interesting in either FOG’s or Apache’s logfiles.

    1 Reply Last reply Reply Quote 0
    • S
      Sebastian Roth Moderator
      last edited by Mar 20, 2021, 12:09 PM

      @altitudehack Interesting one. I don’t think I have ever seen this before, especially with path //boot/grub2 set.

      Let’s try to dig into it. The RecursiveDirectoryIterator called should be the one in function getFilesize (code ref on github). This is being called when you add a snapin (code ref) or update an existing snapin (code ref).

      In both cases the variable $_FILES['snapin']['tmp_name']) is used, which should be set by PHP accordingly when uploading a file - see PHP code ref. So I would imagine that upload_tmp_dir directive was set in php.ini. On the other hand it doesn’t make sense because an earlier upload just worked fine.

      While I usually don’t recommend to just restart things I would give that I try in this case. Restart Apache and PHP-FPM or the whole server and see if it’s still causing the same problem. I have no idea how or why our code would possibly cause this.

      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
      • A
        altitudehack
        last edited by Mar 22, 2021, 3:46 PM

        Thanks for taking a look, @Sebastian-Roth. I encountered this issue on a previous version (I think it was 1.5.4 but can’t swear to that.) Figured the first suggestion was going to be to update it, so I did a full yum update including a reboot for a new kernel, followed by an upgrade to dev-branch and now I’m on 1.5.9.63.
        Is there a verbose logging option to enable?

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by Mar 22, 2021, 4:48 PM

          @altitudehack And you still see the exact same error message even after updating to the latest dev-branch?

          No unfortunately there is no verbose logging at this part of the code. Did you check php.ini just in case?

          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

          A 1 Reply Last reply Mar 22, 2021, 6:11 PM Reply Quote 0
          • A
            altitudehack @Sebastian Roth
            last edited by Mar 22, 2021, 6:11 PM

            @sebastian-roth Looks typical to me:

            ;;;;;;;;;;;;;;;;
            ; File Uploads ;
            ;;;;;;;;;;;;;;;;
            
            ; Whether to allow HTTP file uploads.
            ; http://php.net/file-uploads
            file_uploads = On
            
            ; Temporary directory for HTTP uploaded files (will use system default if not
            ; specified).
            ; http://php.net/upload-tmp-dir
            ;upload_tmp_dir =
            
            ; Maximum allowed size for uploaded files.
            ; http://php.net/upload-max-filesize
            upload_max_filesize = 3000M
            
            ; Maximum number of files that can be uploaded via a single request
            max_file_uploads = 20
            

            Wait a second… I’m at 91% consumed on / . I think the package I’m uploading may exceed the available 580MB available on the partition. It may be a little premature of me, but it looks like this one is solved!

            A 1 Reply Last reply Mar 24, 2021, 12:07 PM Reply Quote 1
            • A
              altitudehack @altitudehack
              last edited by Mar 24, 2021, 12:07 PM

              @altitudehack Confirmed this was caused by running out of disk space. Growing the disk and retrying it worked, so this is solved. Thank you for your time!

              1 Reply Last reply Reply Quote 1
              • 1 / 1
              1 / 1
              • First post
                3/6
                Last post

              160

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project