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

    Snapin error codes

    Scheduled Pinned Locked Moved
    FOG Problems
    4
    9
    3.0k
    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.
    • Scott AdamsS
      Scott Adams
      last edited by Tom Elliott

      I created a snapin that runs a .bat file. If I run the .bat file locally on my computer (not using FOG), it runs fine. Using a FOG Snapin, it looks like it runs, even says successful, but no program is installed.

      What is a return code 4?

      ------------------------------------------------------------------------------
      ---------------------------------SnapinClient---------------------------------
      ------------------------------------------------------------------------------
       6/1/2016 11:00 AM Client-Info Client Version: 0.10.6
       6/1/2016 11:00 AM Client-Info Client OS:      Windows
       6/1/2016 11:00 AM Client-Info Server Version: 7717
       6/1/2016 11:00 AM Middleware::Response Success
       6/1/2016 11:00 AM SnapinClient Snapin Found:
       6/1/2016 11:00 AM SnapinClient     ID: 37
       6/1/2016 11:00 AM SnapinClient     RunWith: cmd.exe
       6/1/2016 11:00 AM SnapinClient     RunWithArgs: /c
       6/1/2016 11:00 AM SnapinClient     Name: Beyond Question
       6/1/2016 11:00 AM SnapinClient     File: BeyondQuestion.bat
       6/1/2016 11:00 AM SnapinClient     Created: 2016-06-01 10:56:52
       6/1/2016 11:00 AM SnapinClient     Args: 
       6/1/2016 11:00 AM SnapinClient     Action: 
       6/1/2016 11:00 AM Middleware::Communication Download: http://fog-server/fog/service/snapins.file.php?mac=F0:1F:AF:29:BF:C2|0C:84:DC:8E:2B:ED|0C:84:DC:8E:2B:ED|0A:00:27:00:00:0E||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&taskid=37
       6/1/2016 11:00 AM SnapinClient C:\Program Files (x86)\FOG\tmp\BeyondQuestion.bat
       6/1/2016 11:00 AM Bus {
        "self": true,
        "channel": "Notification",
        "data": "{\r\n  \"title\": \"Installing Beyond Question\",\r\n  \"message\": \"Please do not shutdown until this is completed\",\r\n  \"subjectID\": \"snapin-Beyond Question\"\r\n}"
      }
       6/1/2016 11:00 AM Bus Emmiting message on channel: Notification
       6/1/2016 11:00 AM SnapinClient Starting snapin...
       6/1/2016 11:00 AM SnapinClient Snapin finished
       6/1/2016 11:00 AM SnapinClient Return Code: 4
       6/1/2016 11:00 AM Bus {
        "self": true,
        "channel": "Notification",
        "data": "{\r\n  \"title\": \"Beyond Question Installed\",\r\n  \"message\": \"Installation has finished and is now ready for use\",\r\n  \"subjectID\": \"snapin-Beyond Question\"\r\n}"
      }
       6/1/2016 11:00 AM Bus Emmiting message on channel: Notification
       6/1/2016 11:00 AM Middleware::Communication URL: http://fog-server/fog/service/snapins.checkin.php?taskid=37&exitcode=4&mac=F0:1F:AF:29:BF:C2|0C:84:DC:8E:2B:ED|0C:84:DC:8E:2B:ED|0A:00:27:00:00:0E||00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0|00:00:00:00:00:00:00:E0&newService&json
      ------------------------------------------------------------------------------
      
      Tom ElliottT 1 Reply Last reply Reply Quote 0
      • Wayne WorkmanW
        Wayne Workman
        last edited by

        Can we get a copy of the .bat file? Remove IPs and replace with x.x.x.x and remove usernames and replace with UserNameGoesHere and passwords with PasswordGoesHere

        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!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        Scott AdamsS 1 Reply Last reply Reply Quote 1
        • Q
          Quazz Moderator
          last edited by Quazz

          I believe the error codes are general windows error codes (correct me if I’m wrong)

          In which case it’s

          ERROR_TOO_MANY_OPEN_FILES
          4 (0x4)
          The system cannot open the file.
          

          https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx

          Which of course isn’t particularly helpful on its own.

          1 Reply Last reply Reply Quote 1
          • Scott AdamsS
            Scott Adams @Wayne Workman
            last edited by Tom Elliott

            @Wayne-Workman

            set programpath=%programfiles(x86)%
            IF %PROCESSOR_ARCHITECTURE%==x86 set programpath=%programfiles%
            IF EXIST "%programpath%\Beyond Question" GOTO END
            xcopy /e "\\x.x.x.x\WES_Apps\Technology\Beyond Question\Beyond Question" "C:\%programpath%\Beyond Question"
            :END
            

            #Edited to show the double slashes by placing in code ticks.

            Wayne WorkmanW Q 2 Replies Last reply Reply Quote 0
            • Wayne WorkmanW
              Wayne Workman @Scott Adams
              last edited by

              @Scott-Adams the xcopy command is using the locally logged in user when you run it manually, and is using SYSTEM when snapins run it. You have to specify credentials, or set the share to read-only for “everyone”.

              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!
              Daily Clean Installation Results:
              https://fogtesting.fogproject.us/
              FOG Reporting:
              https://fog-external-reporting-results.fogproject.us/

              1 Reply Last reply Reply Quote 1
              • Q
                Quazz Moderator @Scott Adams
                last edited by Tom Elliott

                @Scott-Adams

                xcopy /e “\\x.x.x.x\WES_Apps\Technology\Beyond Question\Beyond Question” “C:\%programpath%\Beyond Question”

                should be

                xcopy /e "\\x.x.x.x\WES_Apps\Technology\Beyond Question\Beyond Question" "%programpath%\Beyond Question"

                Since %programpath% will include the drive letter already as inherited from %programfiles(x86)%

                Please test the batch file manually to confirm.

                #Edited to add backticks so we can properly see the command.

                1 Reply Last reply Reply Quote 1
                • Tom ElliottT
                  Tom Elliott @Scott Adams
                  last edited by

                  @Scott-Adams The error codes you see are as they come from the installing program. If it’s from a batch file, it’s likely a batch file error code.

                  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
                    last edited by

                    http://stackoverflow.com/questions/8219040/windows-copy-command-return-codes

                    It’s apparently the error code of a portion of the batch, not the batch itself.

                    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

                    Q 1 Reply Last reply Reply Quote 1
                    • Q
                      Quazz Moderator @Tom Elliott
                      last edited by

                      @Tom-Elliott TIL xcopy has internal error codes, that’s very useful.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post

                      220

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project