Webmastersite.net
Register Log In

All links wiped out after upgrade

Comments on All links wiped out after upgrade

Zihrena
Member

Usergroup: Customer
Joined: Dec 27, 2003

Total Topics: 9
Total Comments: 18
Zihrena
Posted Nov 19, 2009 - 11:51 AM:

I upgraded to 5.1.12 yesterday, and had all almost all of my links wiped out almost ALL THE LINKS (about 95% of them) in the database when I was just deleting ONE link - an error message came up (below). Today I was in the process of replenishing my database (by hand) and must have had close to 100 links back in when WHOOSH - away they went again. I now have a clean database for the second time in two days. This is after approximately 10 years of using the software and accumulating links, I might add. Nothing else was affected (category information, email logs, templates, etc. are all fine). I sent the error message in to the WSN support system, but here it is - maybe someone can spot what went wrong here? Hope it doesn't happen to anyone else.

Script: WSN Links Category: Customer account: (MY EMAIL) Version: WSN Links 5.1.12 URL: http://www.MYDOMAIN.com/guide PHP Version: 5.2.9 Server Test: http://www.MYDOMAIN.com/guide/servertest.php Error occurred at www.MYDOMAIN.com/guide/edit...&filled=1&delete=1&id=2694 on 2009-11-19 18:22:59. Error text: Error #2: 'mysql_fetch_row(): supplied argument is not a valid MySQL result resource' in /home/MYACCOUNT/public_html/guide/databases/mysql.php on line 81. Last SQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Debug info: Load time so far: 0.05 seconds. Query 1: SHOW TABLE STATUS LIKE 'wsnlinks_categories' Load time so far: 0.05 seconds. Query 2: SET CHARACTER SET 'utf8' Load time so far: 0.05 seconds. Query 3: SET character_set_server = 'utf8' Query 4: SELECT [huge field list omitted] FROM wsnlinks_modlog WHERE type='member' AND nature='banned' AND memberid= Step 1 of backtrace: File: /home/MYACCOUNT/public_html/guide/databases/mysql.php Line: 81 Function: mysql_fetch_row Arguments: Step 2 of backtrace: File: /home/MYACCOUNT/public_html/guide/classes/database.php Line: 148 Function: row Arguments: Class: db Step 3 of backtrace: File: /home/MYACCOUNT/public_html/guide/classes/database.php Line: 175 Function: row Arguments: Class: database Step 4 of backtrace: File: /home/MYACCOUNT/public_html/guide/classes/database.php Line: 316 Function: rowitem Arguments: Class: database Step 5 of backtrace: File: /home/MYACCOUNT/public_html/guide/classes/modlog.php Line: 106 Function: selectcount Arguments: modlogtable type='member' AND nature='banned' AND memberid= Class: database Step 6 of backtrace: File: /home/MYACCOUNT/public_html/guide/classes/onelink.php Line: 511 Function: add Arguments: Class: modlog Step 7 of backtrace: File: /home/MYACCOUNT/public_html/guide/includes/editlink.php Line: 50 Function: deletethis Arguments: 1 Class: onelink Step 8 of backtrace: File: /home/MYACCOUNT/public_html/guide/edit.php Line: 153 Function: require_once Arguments: /home/MYACCOUNT/public_html/guide/includes/editlink.php
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 19, 2009 - 2:34 PM:

Are you assuming they're wiped out because they're not showing, or are you actually looking in phpmyadmin to see nothing in the _links table under the browse tab? It seems much more likely that everything would be there and could be recovered with a query or two than that it could all hard-delete.

The error there can't remove any data, it's just saying it doesn't have member id specified related to a link deletion.

There are many ways you could configure a site to have all the links disappear at intervals. Sponsorship with the applicable selections can order everything hidden or soft-deleted. Expirations, effective time and lots of other stuff can be set to eliminate stuff too. All of this would leave the data in the database though and just not show it on the site -- unless you go in and select "hard delete" from the options of what to do when links expire on the Settings -> Links page.
Zihrena
Member

Usergroup: Customer
Joined: Dec 27, 2003

Total Topics: 9
Total Comments: 18
Zihrena
Posted Nov 19, 2009 - 3:56 PM:

No, the first thing I did was go into phpmyadmin and look... there were something like 40+ links of the 800+ that were originally there. I had a backup of an older version of the database and I tried recouping them from there, but it didn't work. At this point I'm really not concerned about the recuperation of the links since I've decided to do something different with the whole site, but I wouldn't want the same thing to happen to anyone else. I do modify my templates but I don't modify anything other than that because I don't know more than the basics of php. What I know happened is that the links disappeared when deleting (supposedly) only one link through the admin panel, right after upgrading to the latest version. When upgrading I really did not change much else because all I was working on was updating the text descriptions and checking (by hand) the validity and quality of each link. I did enable summaries and attachments at that point, which weren't enabled before. Then when deleting another specific link, it happened again, except the 2nd time it deleted all the links. After so many years using WSN links I'm fairly well acquainted with the back end and I do not believe I inadvertently turned on anything that would lead to losing all those links. Just wanted to give a heads up in case it happens again to someone else. Thanks for taking a look at it. I thought maybe that error message would give some kind of more definite clue.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 20, 2009 - 5:14 AM:

Can you list the exact steps you took in doing the deletion, so I can see where you're doing something differently from me?

If you can reproduce this every time you follow those steps, but it turns out I can't on my copies of the script, I'll need you to fill out the free inspection request form: http://www.wsnlinks.com/inspection.html

Did you back up data only without structure? If you backed up structure too, it'll work once you run upgrade.php on the old table.
Zihrena
Member

Usergroup: Customer
Joined: Dec 27, 2003

Total Topics: 9
Total Comments: 18
Zihrena
Posted Nov 20, 2009 - 10:01 AM:

The process I was going through both times was: I opened a link to edit it, clicked on the link itself to open it (in another window) and check the status and quality, then I returned to the edit page and if I wanted to delete it, I checked the "Hard Delete" button, or edited what was necessary, saved it and that's it. Most of the time the links were deleted normally. There are a few links I did not hard delete, but most of them I did. I cannot tell you for sure if the links I did not hard delete were the ones that caused the problem, but I intend to check that out. I certainly deleted many links without the error coming up, so it wasn't consistent in that sense.

I have been able to reload the backup of the table and upgrade it, thanks. I now have most of the information although my backup wasn't the most recent (when will we ever learn...??) So I'll start the process again and pay more attention to the actual steps so that if it happens again, I can give you clearer information.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 22, 2009 - 4:54 PM:

I'm pretty sure it must've been on a hard delete, since that at least is supposed to remove something from the database, so it's more plausible for some condition to cause it to delete too much than to suddenly create a delete out of the blue. Plus I don't do a lot of hard deletes and I don't think most people do so they're less tested.

I'll see what looks suspicious around that code. I see some code for removing aliases that I believe could delete everything if somehow triggered for a link with the id number 0 -- that shouldn't be possible, but I'll add a check for a non-zero id number just in case.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.