We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12153
    • 24 Posts
    After 2 years running a 200+ page site with modx 0.9.3 without a problem, file manager suddenly went wonky and my css files were all deleted when all I did was use file manager to open the folder that contained them (assets/templates/mysite). I originally posted about this on the 0.9.x forum about a week ago and was told to upgrade.

    I am now running Evolution 1.04. The upgrade went smoothly, and at first I thought all was fine, but when I used file manager to open assets/templates/mysite, all my css files were again deleted (the php files were left untouched). Then when I opened assets/files/events all my jpg files were deleted (but doc,pdf, txt were untouched). The same thing happened in any assets/files subfolders I opened. When, just to test, I opened assets/templates/modxhost all of the css and js files were deleted (tpl file was untouched). In addition, all of the jpg and gif files inside of the templates/modxhost/images folder were deleted, but the png files were left untouched. I never even opened modxhost/images to view these files.

    All of these deletions are recorded in the manager logs. At first I thought maybe it was some kind of allowable file types issue, and I added jpg and gif to upload-able file types for assets/files but this didn’t help- the files continued to be deleted when viewed in file manager. Files in the assets-old file that is still on the server from the upgrade are also deleted when viewed. I have a copy of the site on my local server and cannot replicate the problem there- only on the live site. Also. it is not a problem to view/upload/download files with ftp pro or filezilla.

    I searched the forums and bugs and all I found was this unresolved issue from a couple of years ago-
    Bug #1871- http://bugs.modx.com/issues/1871

    It’s rather critical- my clients were at the controls the first time random files were deleted and they are pretty freaked out... Luckily I had everything backed up and could get it back to "normal" on the front end, but I am stumped and very worried about the stability of the site- and I can’t turn this site back over to the clients unless I can solve it...

    Any help is greatly appreciated! - Teri

    MySQL version 5.1.47-community-log
    No tables over 1MB
    Apache version 2.2.16
    PHP version 5.2.14
    Linux
    Architecture x86_64
    I have windows XP SP3, Firefox 3.6.
    website - http://www.familyofwoodstockinc.org/
      ModX 1.0.4
      MySQL version 5.1.47-community-log
      No tables over 1MB
      Apache version 2.2.16
      PHP version 5.2.14
      Linux
      Architecture x86_64
      I have windows XP SP3, Firefox 3.6.
      • 9085
      • 630 Posts
      Can you make a new site|subdomain on the same server with fresh installation (not update) last MODx Evo and replicate bug?
      Is any manager (with roles admin, editor, publisher) delete files?
      What messages are in apache’s access.log at this time (when filemanager "delete" files)?
      Try to open filemanager’s page with firefox with firebug, for example, to trace requests and javascripts...

      * If it’s possible - to provide manager’s and ftp access
        Правильно заданный вопрос повышает вероятность получения нужного ответа.
        Что-то не работает? Загляните в лог ошибок!
        Есть проблема? "Локализуйте" её!
        Ответы на большинство вопросов по MODx | MODx RTFM | API Evo Revo | галопом по Европам Азиям smiley wikibooks(ru) Ditto(en) | Wayfinder e-book | Заметки и о MODx
        • 12153
        • 24 Posts
        At the moment I am the only one accessing the manager, so no one else is deleting any files. I can see it happening in almost real time. I open filemanager and navigate to folder x (I do nothing, just navigate in and view the files), then navigate back to top level. Then I immediately use filezilla to navigate to folder x- just some files are deleted, like all jpgs or all css, other files in the same folder are left alone. I use filezilla to replace these files from my backup and keep the site whole. The manager logs show that I supposedly deleted these files when in fact I did nothing but view them.

        I’m afraid of testing on the live site anymore- I don’t want it to fall apart more than it already has.... my client is very upset already (they’re already talking about dumping modx and rebuilding in a "more stable" cms- and since I’m the one who sold them on modx in the first place they won’t pay for a rebuild... so I REALLY need to solve this problem)

        I sent up the only error log I could find on my server- http://www.familyofwoodstockinc.org/server-error-log.txt
        I included anything even close to the time/date of the problem. First noticed it on Dec. 11 using 0.9.3. Upgraded to 1.04 on Dec 18th (ignore the errors about not finding modx carbon theme- that was just me not sending the theme up... was easily and immediately fixed)

        I can’t give manager/ftp access without permission from the client- I imagine they will be very reluctant to give that out (certainly not on a public forum). Also- if I give you access and you go up and test this and files are deleted, then part of the site is broken (or all of it in the case of the missing css files)and you can’t send the files back up to fix it. I don’t think the client will go for that. I know that giving manager/ftp access may ultimately be the only way to get help, but I think it needs to be absolutely last resort.

        I can set up a subdomain and do a fresh install, but this will take me a day or two. (I have satellite internet and uploads are pretty bad- it took me over 8 hrs to upload the upgrade files...). Should I try to import the old site to the new install (helpful hints on how to do that are appreciated), or should I just install the demo site and see how file manager works with that?

        Thanks again for your help.



          ModX 1.0.4
          MySQL version 5.1.47-community-log
          No tables over 1MB
          Apache version 2.2.16
          PHP version 5.2.14
          Linux
          Architecture x86_64
          I have windows XP SP3, Firefox 3.6.
          • 18913
          • 654 Posts
          As a test, could you go to some non-critical folder (assuming there is one), set the permissions on all the files there to be read-only, then view them to see if they get deleted? Perhaps if they *aren’t* deleted in that case a combination of the error logs and a review of your php settings will help?

          Looking at the error log you posted, it seems as though the code is expecting to see a frame parameter when in fact none is set. Dunno what’s causing that.

          Anyway, just a thought and an observation.
          Matt
            • 12153
            • 24 Posts
            I think the frame error is coming up because in trying to troubleshoot I opened some manager tabs in a new firefox tab and they came up without the frame. Don’t think that has anything to do with my problem, but I don’t know enough about this to be sure of that.
              ModX 1.0.4
              MySQL version 5.1.47-community-log
              No tables over 1MB
              Apache version 2.2.16
              PHP version 5.2.14
              Linux
              Architecture x86_64
              I have windows XP SP3, Firefox 3.6.
              • 18913
              • 654 Posts
              The only other way I can think to debug this would be to start putting "echo" statements in the file.dynamic.php code and see where that code is getting called. From what I understand you said, you can view the files in the manager, move to another folder and then go back - and they’re gone. But not the folder itself. So if you could set up some folder that isn’t really used by the website, you could do live experimenting without jeopardizing the site itself. At least that would be my hunch.
              Matt
                • 12153
                • 24 Posts
                I did a lot of testing on a non-critical folder. Every time I went in with file manager files would disappear- only specific file types in each folder I viewed(the types of files deleted change from folder to folder- sometimes all jpg and gif are gone, but png is untouched, or css is gone but php in the same folder is untouched....) I don’t know enough about php to write echo statements- can you give me more specific help as to how to do that and view the results.

                I did find this code in manager/actions/document_data.static.php
                function deletedocument() {
                	if(confirm("<?php echo $_lang['confirm_delete_resource']?>")==true) {
                		document.location.href="index.php?id=<?php echo $_REQUEST['id']?>&a=6";
                	}


                I see a bit more what you mean by echo statements, but don’t know where/how to put them in files.dynamic.php.
                Do you know which php files deal with specifically with file manager? I’m not sure, and at least that would give me a place to start looking for problems...

                Live experimenting still scares me even on non-critical folders. This issue came up seemingly out of the blue after 2 years of running a stable site. Without knowing what the real problem is I’m afraid that continued testing may cause my main folders to start disappearing. I know it’s unlikely, but this whole problem is unlikely to begin with. I can re-install from backups if I have to, but this will take time and my client is already pissed off and a bit freaked out about the site going down....

                  ModX 1.0.4
                  MySQL version 5.1.47-community-log
                  No tables over 1MB
                  Apache version 2.2.16
                  PHP version 5.2.14
                  Linux
                  Architecture x86_64
                  I have windows XP SP3, Firefox 3.6.
                  • 18913
                  • 654 Posts
                  Can you identify when all this started and if so can you find out from the webhost if they made server software changes at that time (e.g. "upgraded" Apache or PHP, etc.)?

                  It seems to me that the list of files/folders is created in a function call on line 497. So if you can see in the log the timestamp for your files being deleted, I would guess you could do something like this :
                  print strftime("%H:%M:%S").' '.microtime().'Going into ls ...<br/>';
                  ls($startpath);
                  print 'Coming out of ls ... '.strftime("%H:%M:%S").' '.microtime().'<br/>';
                  echo "\n\n\n\n\n\n\n";
                  


                  So - for example - if you wanted to know if it was something in that call that is the culprit you could look at the timestamps of the deletions and compare them to what you would see on the screen, an example of which is attached. This show hours, minutes, second and microseconds. Dunno if your log info gets that granular, but it might be a way of narrowing down where things are going goofy.

                  Anyway, just a thought. I totally get your concern over debugging site that’s live...

                  Matt


                    • 12153
                    • 24 Posts
                    Thanks Matt- I checked with my host and the only thing they’ve done was update the kernel on Dec. 14th, which is after the problem began (Dec 5th is first know instance). Also, I think I understand the echo statement, but I’m not sure that it tells me anything I don’t already know. My log timestamps deleting the file at the same time as viewing it- with a 1 second delay for the first file in the folder. If the folder contains lots of files then viewing isn’t logged, just all of the deletes- and it keeps deleting for as long as I have the folder open, stops deleting when I close it.

                    I have now done a fresh install in a new sub domain so this can be tested, and it behaves just as badly as the site. I uploaded my asset/files, assets/templates, and assets/images with the initial assets folder before the install so I’d have files to test with, but everything else is fresh out of the newly unzipped modx 1.04 file and the database was new and empty. I did not install the sample site. When the install completed I saved my config settings (all the defaults) and went to file manager, navigated to assets/templates/mysite , paused there for 15 seconds or so, then went to reports/manager actions to view the log- all of my css files were deleted at the same time as they were viewed -php were left untouched. I repeated this with assets/templates/modxhost - all of the css and js files were deleted, tpl was left untouched. Whenever I viewed a folder in assets/files AND assets/images all jpg and gif files were deleted, but bmp, png, doc, pdf, txt and html were left untouched.

                    I am now sending up yet another fresh install to another subdomain- this time nothing but freshly unzipped modx files. I will update this post when it is complete and I can test it.
                    UPDATE- Totally fresh install in a new subdomain still deletes files.

                    I can set up ftp/manager access to these test sites if anyone is expert and helpful enough to want to look around. Esche, are you still following the thread?
                      ModX 1.0.4
                      MySQL version 5.1.47-community-log
                      No tables over 1MB
                      Apache version 2.2.16
                      PHP version 5.2.14
                      Linux
                      Architecture x86_64
                      I have windows XP SP3, Firefox 3.6.
                      • 21257 MODX Staff
                      • 730 Posts
                      I would love to help get to the bottom of this. I filed that original bug ticket you referenced earlier, so I’m pretty familiar with the strangeness of this problem. I’m also working on a lot of changes for the 1.0.5 version.
                      Please PM me at your convenience.
                        Mike Schell
                        Lead Developer, MODX Cloud
                        Email: [email protected]
                        GitHub: https://github.com/netProphET/
                        Twitter: @mkschell