FOG Project

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

    Solved /opt/fog/snapins disappearing

    Bug Reports
    snapins deleting files
    5
    23
    6203
    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.
    • I
      ITSolutions Testers last edited by

      On Ubuntu 14.04, FOG Trunk 6150

      If I try to create a snapin without a file associated with it it deletes all the snapin files in my /opt/fog/snapin directory. I noticed that they had been deleted a couple weeks ago but wasn’t sure why. I had just tried to update to the latest trunk that day and assumed it was a bug in the update. But today I just tried to create a snapin without any file association and it took forever to error out and then didn’t create the snap in. I then went to add a file and found that the snapin directory was empty. I restored from a back up and tried again and got the same results.

      I have a few commands that I need/want to run and instead of creating a batch file I just figured it was easier to add the commands as snapins. Turns out FOG doesn’t like that. I am fine with having to do a file upload as a batch file instead, but deleting the snapins is not a good result of accidentally forgetting to select a file.

      Wayne Workman 1 Reply Last reply Reply Quote 0
      • I
        ITSolutions Testers last edited by

        Sorry for not responding earlier, Yes this is solved. Thanks again for all the hard work @Developers and everyone else.

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

          @apathetic_admin This errors should no longer be present and the random deletions are fixed. I’m going to solve the thread.

          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 1
          • apathetic_admin
            apathetic_admin @Wayne Workman last edited by

            @Wayne-Workman Yeah sorry I thought I had mentioned that earlier. They were fine.

            Tom Elliott 1 Reply Last reply Reply Quote 1
            • R
              RipAU @Tom Elliott last edited by

              @Tom-Elliott I Just updated my storage node with the latest SVN to fix the Snapin issue and noticed an error at the end.
              It did report that it installed everything correctly and seems to be working but the errors I noticed are

               * Starting FOGScheduler.service Service.......................OK
               * Starting FOGPingHosts.service Service.......................OK
               * Setting up exports file.....................................OK
               * Setting up and starting RPCBind.............................OK
               * Setting up and starting NFS Server..........................OK
              sed: -e expression #1, char 76: unknown option to `s'
              sed: -e expression #1, char 88: unknown option to `s'
              
               * Setup complete
              
              
               * You still need to setup this node in the fog management
               | portal. You will need the username and password listed
               | below.
              
               * Management Server URL:
              

              I thought I would reply here as I thought this might be related to the latest fixes?

              Cheers!

              1 Reply Last reply Reply Quote 0
              • Tom Elliott
                Tom Elliott @Wayne Workman last edited by

                @Wayne-Workman I’ve added your code and then I made a bunch of modifications to more appropriately check things.

                First, uploaded files – I think – should always supersede the “existing file” chosen. So this is now implemented.

                My checks do now verify if the file exists before attempting to delete it. However, most notably, I think, the code will not attempt to even create/edit the source if the snapinfile choices don’t exist (aren’t set). It will ONLY delete the file in the case of the uploaded file, and even then only if the file exists first.

                Hopefully this fixes the issues described here and in the other thread.

                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

                R 1 Reply Last reply Reply Quote 0
                • Wayne Workman
                  Wayne Workman @apathetic_admin last edited by Wayne Workman

                  @apathetic_admin said:

                  @Wayne-Workman I was able to add a new snapin without doing anything but putting a name in and selecting the storage node. I suppose that’s okay though, yeah?

                  The real question is were existing snapin files deleted again?

                  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/

                  Tom Elliott apathetic_admin 2 Replies Last reply Reply Quote 0
                  • apathetic_admin
                    apathetic_admin @Wayne Workman last edited by

                    @Wayne-Workman I was able to add a new snapin without doing anything but putting a name in and selecting the storage node. I suppose that’s okay though, yeah?

                    Wayne Workman 1 Reply Last reply Reply Quote 0
                    • Wayne Workman
                      Wayne Workman @apathetic_admin last edited by

                      @apathetic_admin Awesome. Now, can someone please take a deep breath and try to create a new snapin without a file ?

                      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/

                      apathetic_admin 1 Reply Last reply Reply Quote 0
                      • apathetic_admin
                        apathetic_admin @Wayne Workman last edited by

                        @Wayne-Workman That seems to have done the trick.

                        If I select a file to upload, and I select a file that’s already existing, I get the new file uploaded when I update the snapin, but the snapin is configured to use the existing file I selected in the dropdown. That might not be related at all to anything we just did, I just tried it out to see what it’d do.

                        Wayne Workman 1 Reply Last reply Reply Quote 0
                        • Wayne Workman
                          Wayne Workman @apathetic_admin last edited by

                          @apathetic_admin Small change, try this: https://github.com/FOGProject/fogproject/pull/82/files

                          You’re just basically moving the closing } down below the put statement, that way the put never happens either if the filename is blank.

                          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/

                          apathetic_admin 1 Reply Last reply Reply Quote 0
                          • apathetic_admin
                            apathetic_admin @Wayne Workman last edited by

                            @Wayne-Workman No, just selecting an existing file. This is what caused it to delete all the snapin files before.

                            1 Reply Last reply Reply Quote 0
                            • Wayne Workman
                              Wayne Workman @apathetic_admin last edited by

                              @apathetic_admin Are you uploading a file or not?

                              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/

                              apathetic_admin 1 Reply Last reply Reply Quote 0
                              • apathetic_admin
                                apathetic_admin @Wayne Workman last edited by

                                @Wayne-Workman
                                I made the same change as what you made and now I am getting

                                FOGFTP: Failed to put file. Remote Path: /opt/fog/snapins/, Local Path: , Error: ftp_put(): Filename cannot be empty
                                
                                Wayne Workman 2 Replies Last reply Reply Quote 0
                                • Wayne Workman
                                  Wayne Workman @Wayne Workman last edited by Wayne Workman

                                  @Wayne-Workman I think I found the problem and I’ve made a fix here: https://github.com/FOGProject/fogproject/pull/82/files

                                  Specifically this file: /var/www/html/fog/lib/pages/snapinmanagementpage.class.php at line 161

                                  You can try it out, but Tom will need to review it and merge for it to be put into the main fog repo.

                                  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/

                                  apathetic_admin 1 Reply Last reply Reply Quote 0
                                  • I
                                    ITSolutions Testers @Wayne Workman last edited by

                                    @Wayne-Workman That makes perfect sense, I hadn’t considered that it might need to delete an existing file before uploading a new file. I think a check in the code to ensure a file is selected before going further would solve this. I am not a PHP or HTML coder at all so unfortunately I wouldn’t be able to help much with this. I can script in windows and a little it Linux but not sure that will do much in this case.

                                    1 Reply Last reply Reply Quote 0
                                    • Wayne Workman
                                      Wayne Workman @ITSolutions last edited by

                                      @ITSolutions said:

                                      If I try to create a snapin without a file associated with it it deletes all the snapin files in my /opt/fog/snapin directory.

                                      Just from programming experience and from how the issue is described by ITSolutions,
                                      Most likely, what’s happening is

                                      Before the web interface uploads the snapin, it deletes any of the same name.

                                      so for my.msi it’d delete /opt/fog/snapins/my.msi
                                      if the file field is blank
                                      it’s probably doing this:
                                      delete /opt/fog/snapins/

                                      Just a guess.

                                      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/

                                      I Wayne Workman 2 Replies Last reply Reply Quote 0
                                      • apathetic_admin
                                        apathetic_admin @Tom Elliott last edited by

                                        @Tom-Elliott

                                        I copied my snapin files back over from my old server, and I opened an existing snapin and uploaded a new version and the other snapins files are still there.

                                        I created a new snapin, uploaded a new file, and the other files are still there.

                                        I created a new snapin and selected an existing file and it wiped out all my snapin files.

                                        My guys are saying

                                        “Because after I uploaded the new Chrome, the list of files disappeared and only the one I uploaded was there.
                                        As in, where it says “Snapin File (Exists)” where I can select already uploaded files. It had all the other files listed, then when I made the new spapin and uploaded Chrome, they all vanished, except the new chrome.
                                        ”

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

                                          @Tom-Elliott I’m not sure. I’m about to copy them back over and then upload a new file through the snapin manager. Will report back.

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

                                            @apathetic_admin so the files are only deleting when a new file is uploaded?

                                            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

                                            apathetic_admin 2 Replies Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            231
                                            Online

                                            10.2k
                                            Users

                                            16.3k
                                            Topics

                                            149.9k
                                            Posts

                                            Copyright © 2012-2020 FOG Project