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

    Snapin Pack Arguments double-quotes problem

    Scheduled Pinned Locked Moved Solved FOG Problems
    19 Posts 4 Posters 1.4k Views
    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.
    • Tom ElliottT
      Tom Elliott @Infojoe
      last edited by

      @Infojoe Please try the latest dev branch. this should be fixed.

      The issue was simple:

      Basically the arguments are stored and from what I could tell, work, but when the HTML side would go to re-display it it would make an input value of:

      value="    -Execution -File "[FOG_SNAPIN].PS1""
      

      Do you see the problem?

      From HTML side, it would think the string ended at the first double quote.

      This has been found and should be fixed in the latest dev-branch.

      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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      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

      I 1 Reply Last reply Reply Quote 0
      • I
        Infojoe
        last edited by Infojoe

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • I
          Infojoe @Tom Elliott
          last edited by

          @Tom-Elliott
          Corrected in 1.5.10.1744 !
          Thank you mastacontrola and Tom 👍 😊

          Tom ElliottT 1 Reply Last reply Reply Quote 0
          • Tom ElliottT
            Tom Elliott @Infojoe
            last edited by

            @Infojoe They are one in the same lol and you’re welcome.

            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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            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
            • Tom ElliottT Tom Elliott has marked this topic as solved
            • AUTH IT CenterA
              AUTH IT Center
              last edited by

              @Tom-Elliott what happens when we want the default snapin use (no added arguments before the file)? With the latest patch 1.5.10.1754 (htmlspecialchars escape) all our previous working powershell snapins are failing.

              0c9ee852-a0bb-4769-9309-0b3c82ec4ca8-image.png

              The snapin command preview is correct but the dashboard returns error 500

              073df294-b42f-4fde-b10c-77b66f4cb5b4-image.png

              Related commit: https://github.com/FOGProject/fogproject/commit/473787d0f59b9df77f675b24fa74fd6153a57c59

              Tom ElliottT 1 Reply Last reply Reply Quote 0
              • Tom ElliottT
                Tom Elliott @AUTH IT Center
                last edited by

                @AUTH-IT-Center Since it’s writing a 500 can you provide the php-fpm www-error.log (if redhat based or apache2.log if debian)?

                There’s likely some syntax issue I’m unaware of:

                For the htmlspecialchars it’s only display representation:

                When the HTML forms are built, we encode things which allows the fields to display correctly, and when you hit safe we decode them to ensure they’re stored in the DB correctly.

                This leads me to believe this isn’t really the problem but there’s some other syntax issue that I may have missed/added unsuspectingly?

                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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                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

                AUTH IT CenterA 1 Reply Last reply Reply Quote 0
                • AUTH IT CenterA
                  AUTH IT Center @Tom Elliott
                  last edited by

                  @Tom-Elliott

                  [Wed Jan 21 10:55:51.389462 2026] [proxy_fcgi:error] [pid 206230] [client computer_ip:57559] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /var/www/html/fog/lib/fog/image.class.php:496\nStack trace:\n#0 /var/www/html/fog/lib/fog/image.class.php(496): min()\n#1 /var/www/html/fog/lib/fog/image.class.php(389): Image->getPrimaryGroup()\n#2 /var/www/html/fog/lib/fog/host.class.php(1133): Image->getStorageGroup()\n#3 /var/www/html/fog/lib/fog/host.class.php(1408): Host->_createTasking()\n#4 /var/www/html/fog/lib/fog/fogpage.class.php(1757): Host->createImagePackage()\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->deployPost()\n#6 /var/www/html/fog/management/index.php(69): FOGPageManager->render()\n#7 {main}\n  thrown in /var/www/html/fog/lib/fog/image.class.php on line 496', referer: https://hostname.it.auth.gr/fog/management/index.php?node=host&sub=deploy&id=369&type=13
                  [Wed Jan 21 10:57:46.453159 2026] [proxy_fcgi:error] [pid 206208] [client computer_ip:62589] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /var/www/html/fog/lib/fog/image.class.php:496\nStack trace:\n#0 /var/www/html/fog/lib/fog/image.class.php(496): min()\n#1 /var/www/html/fog/lib/fog/image.class.php(389): Image->getPrimaryGroup()\n#2 /var/www/html/fog/lib/fog/host.class.php(1133): Image->getStorageGroup()\n#3 /var/www/html/fog/lib/fog/host.class.php(1408): Host->_createTasking()\n#4 /var/www/html/fog/lib/fog/fogpage.class.php(1757): Host->createImagePackage()\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->deployPost()\n#6 /var/www/html/fog/management/index.php(69): FOGPageManager->render()\n#7 {main}\n  thrown in /var/www/html/fog/lib/fog/image.class.php on line 496', referer: https://hostname.it.auth.gr/fog/management/index.php?node=host&sub=deploy&id=369&type=13
                  [Wed Jan 21 10:58:23.857033 2026] [proxy_fcgi:error] [pid 277454] [client computer_ip:49357] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /var/www/html/fog/lib/fog/image.class.php:496\nStack trace:\n#0 /var/www/html/fog/lib/fog/image.class.php(496): min()\n#1 /var/www/html/fog/lib/fog/image.class.php(389): Image->getPrimaryGroup()\n#2 /var/www/html/fog/lib/fog/host.class.php(1133): Image->getStorageGroup()\n#3 /var/www/html/fog/lib/fog/host.class.php(1408): Host->_createTasking()\n#4 /var/www/html/fog/lib/fog/fogpage.class.php(1757): Host->createImagePackage()\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->deployPost()\n#6 /var/www/html/fog/management/index.php(69): FOGPageManager->render()\n#7 {main}\n  thrown in /var/www/html/fog/lib/fog/image.class.php on line 496', referer: https://hostname.it.auth.gr/fog/management/index.php?node=host&sub=deploy&id=369&type=13
                  [Wed Jan 21 10:58:40.252836 2026] [proxy_fcgi:error] [pid 255909] [client computer_ip:58776] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /var/www/html/fog/lib/fog/image.class.php:496\nStack trace:\n#0 /var/www/html/fog/lib/fog/image.class.php(496): min()\n#1 /var/www/html/fog/lib/fog/image.class.php(389): Image->getPrimaryGroup()\n#2 /var/www/html/fog/lib/fog/host.class.php(1133): Image->getStorageGroup()\n#3 /var/www/html/fog/lib/fog/host.class.php(1408): Host->_createTasking()\n#4 /var/www/html/fog/lib/fog/fogpage.class.php(1757): Host->createImagePackage()\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->deployPost()\n#6 /var/www/html/fog/management/index.php(69): FOGPageManager->render()\n#7 {main}\n  thrown in /var/www/html/fog/lib/fog/image.class.php on line 496', referer: https://hostname.it.auth.gr/fog/management/index.php?node=host&sub=deploy&id=369&type=13
                  [Wed Jan 21 11:09:53.556796 2026] [proxy_fcgi:error] [pid 231725] [client computer_ip:59174] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /var/www/html/fog/lib/fog/image.class.php:496\nStack trace:\n#0 /var/www/html/fog/lib/fog/image.class.php(496): min()\n#1 /var/www/html/fog/lib/fog/image.class.php(389): Image->getPrimaryGroup()\n#2 /var/www/html/fog/lib/fog/host.class.php(1133): Image->getStorageGroup()\n#3 /var/www/html/fog/lib/fog/host.class.php(1408): Host->_createTasking()\n#4 /var/www/html/fog/lib/fog/fogpage.class.php(1757): Host->createImagePackage()\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->deployPost()\n#6 /var/www/html/fog/management/index.php(69): FOGPageManager->render()\n#7 {main}\n  thrown in /var/www/html/fog/lib/fog/image.class.php on line 496', referer: https://hostname.it.auth.gr/fog/management/index.php?node=host&sub=deploy&id=369&type=13
                  [Wed Jan 21 11:13:02.195715 2026] [proxy_fcgi:error] [pid 259259] [client computer_ip:59235] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /var/www/html/fog/lib/fog/image.class.php:496\nStack trace:\n#0 /var/www/html/fog/lib/fog/image.class.php(496): min()\n#1 /var/www/html/fog/lib/fog/image.class.php(389): Image->getPrimaryGroup()\n#2 /var/www/html/fog/lib/fog/host.class.php(1133): Image->getStorageGroup()\n#3 /var/www/html/fog/lib/fog/host.class.php(1408): Host->_createTasking()\n#4 /var/www/html/fog/lib/fog/fogpage.class.php(1757): Host->createImagePackage()\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->deployPost()\n#6 /var/www/html/fog/management/index.php(69): FOGPageManager->render()\n#7 {main}\n  thrown in /var/www/html/fog/lib/fog/image.class.php on line 496', referer: https://hostname.it.auth.gr/fog/management/index.php?node=host&sub=deploy&id=369&type=13
                  [Wed Jan 21 11:28:48.963228 2026] [proxy_fcgi:error] [pid 279174] [client computer_ip:49452] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /var/www/html/fog/lib/fog/image.class.php:496\nStack trace:\n#0 /var/www/html/fog/lib/fog/image.class.php(496): min()\n#1 /var/www/html/fog/lib/fog/image.class.php(389): Image->getPrimaryGroup()\n#2 /var/www/html/fog/lib/fog/host.class.php(1133): Image->getStorageGroup()\n#3 /var/www/html/fog/lib/fog/host.class.php(1408): Host->_createTasking()\n#4 /var/www/html/fog/lib/fog/fogpage.class.php(1757): Host->createImagePackage()\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->deployPost()\n#6 /var/www/html/fog/management/index.php(69): FOGPageManager->render()\n#7 {main}\n  thrown in /var/www/html/fog/lib/fog/image.class.php on line 496', referer: https://hostname.it.auth.gr/fog/management/index.php?node=host&sub=deploy&id=369&type=13
                  
                  Tom ElliottT 1 Reply Last reply Reply Quote 0
                  • Tom ElliottT
                    Tom Elliott @AUTH IT Center
                    last edited by

                    Okay thanks for that, that helped me fix that particular problem and address another elephant I didn’t realize still existed:

                    Non-Imaging tasks should not require an Image to create a task - which is partly (i believe) why you saw that error.

                    I’m only guessing here that this was a machine that did not have an image defined to it? If not there’s another rabbit hole I’m not sure I’m ready to dig into right away, but I did add corrections that non-imaging tasks shouldn’t require an image being set on the host level to create the tasking in the first place as well added some failsafes around that particular error:

                    $assocID = @min((array) $assocID);
                    

                    Was the error it was hitting at line 496, basically with PHP 8, they made min function require a value and if assocID is empty (set just earlier) that’s why you were seeing an error. The assocID here specifically represented the image association on a storage group.

                    I corrected this specifically by setting assocID to null if there’s nothing in the returned assocIDs previously.

                    Apologies for the long winded answer.

                    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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                    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

                    AUTH IT CenterA 1 Reply Last reply Reply Quote 0
                    • AUTH IT CenterA
                      AUTH IT Center @Tom Elliott
                      last edited by AUTH IT Center

                      @Tom-Elliott said in Snapin Pack Arguments double-quotes problem:

                      I’m only guessing here that this was a machine that did not have an image defined to it?
                      …
                      I corrected this specifically by setting assocID to null if there’s nothing in the returned assocIDs previously.

                      Apologies for the long winded answer.

                      You are correct. The host doesn’t have image associated (as many of our hosts 🙂 ).

                      Unfortunately seems with have to dig more…

                      [Wed Jan 21 14:52:42.687383 2026] [proxy_fcgi:error] [pid 2630261] [client computer_ip:50247] AH01071: Got error 'PHP message: PHP Warning:  Attempt to read property "dev" on null in /var/www/html/fog/lib/pages/dashboardpage.class.php on line 586PHP message: PHP Warning:  Attempt to read property "rx" on null in /var/www/html/fog/lib/pages/dashboardpage.class.php on line 588PHP message: PHP Warning:  Attempt to read property "tx" on null in /var/www/html/fog/lib/pages/dashboardpage.class.php on line 589', referer: https://dev-hostname.it.auth.gr/fog/management/index.php?node=home
                      [Wed Jan 21 14:55:03.693789 2026] [proxy_fcgi:error] [pid 2665714] [client computer_ip:57526] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /var/www/html/fog/lib/fog/image.class.php:496\nStack trace:\n#0 /var/www/html/fog/lib/fog/image.class.php(496): min()\n#1 /var/www/html/fog/lib/fog/image.class.php(389): Image->getPrimaryGroup()\n#2 /var/www/html/fog/lib/fog/host.class.php(1133): Image->getStorageGroup()\n#3 /var/www/html/fog/lib/fog/host.class.php(1408): Host->_createTasking()\n#4 /var/www/html/fog/lib/fog/fogpage.class.php(1757): Host->createImagePackage()\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(220): FOGPage->deployPost()\n#6 /var/www/html/fog/management/index.php(69): FOGPageManager->render()\n#7 {main}\n  thrown in /var/www/html/fog/lib/fog/image.class.php on line 496', referer: https://dev-hostname.it.auth.gr/fog/management/index.php?node=host&sub=deploy&id=1&type=13
                      

                      @Tom-Elliott said in Snapin Pack Arguments double-quotes problem:

                      I corrected this specifically by setting assocID to null if there’s nothing in the returned assocIDs previously.

                      the imageID in the database is int so maybe the null value causes the error?

                      FYI I am checking it on the DEV VM (other host without image association).

                      Tom ElliottT 1 Reply Last reply Reply Quote 0
                      • Tom ElliottT
                        Tom Elliott @AUTH IT Center
                        last edited by

                        @AUTH-IT-Center I added another update but the error you’re seeing is a little strange because it should’ve bene addressed, I don’t know. The min() item is saying it requires a value and the approach I took was to check if there is data in the array, pass it to the min funciton otherwise set it to null (which should work if true)

                        Of course i don’t have much time to dig deep into this today, but my testing seemed to work without much issue.

                        Let me see if I can create a host without an image associated, tie a snapin and make a snapin task.

                        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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                        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
                        • 1 / 1
                        • First post
                          Last post

                        164

                        Online

                        12.5k

                        Users

                        17.5k

                        Topics

                        156.2k

                        Posts
                        Copyright © 2012-2026 FOG Project