GUI Mapper error reporting

Posted by Starcomet on Fri 01 May 2015 12:33 AM — 14 posts, 45,154 views.

#0
After installing the newer version of Mushclient, the GUI mapper no longer wishes to work for me. Here is the error crash report I received.

Error number: 0
Event: Run-time error
Description: [string "Plugin"]:112: FOREIGN KEY constraint failed

stack traceback:

[C]: in function 'error'

[string "Plugin"]:66: in function 'dbcheck'

[string "Plugin"]:112: in function 'save_exits_to_database'

[string "Plugin"]:952: in function 'f'

[string "Plugin"]:1048: in function <[string "Plugin"]:1044>
Called by: Function/Sub: OnPluginBroadcast called by Plugin ATCP_Mapper

Reason: Executing plugin ATCP_Mapper sub OnPluginBroadcast
#1
Hmm could it be that the plugin requiring 4.51 is the issue? Is there an updated version of it?
#2
Here is another error after I uninstalled and reinstalled version 4.97

[string "Plugin"]:131: FOREIGN KEY constraint failed
stack traceback:
[C]: in function 'error'
[string "Plugin"]:74: in function 'dbcheck'
[string "Plugin"]:131: in function 'save_exits_to_database'
[string "Plugin"]:1122: in function 'f'
[string "Plugin"]:1239: in function <[string "Plugin"]:1233>
#3
And I am playing Achaea in case that helps.
Australia Forum Administrator #4
Starcomet said:

Hmm could it be that the plugin requiring 4.51 is the issue?


No, that is the minimum version.
Australia Forum Administrator #5
If everything was working before you could always go back to the earlier version.
#6
I re downloaded version 4.75 and the mapper is working fine again. I am not sure why it refuses to draw the paths on the newer version.
USA #7
I suspect it has something to do with
Quote:
Upgraded SQLite3 library to 3.8.8.3
update in the 4.97 release, though it's odd that it hasn't cropped up until now.
#8
What is your suggestion for fixing it Meerclar? I am fine with using this older version, but I think it would be best to update to the newest version.
Amended on Fri 01 May 2015 08:35 PM by Starcomet
Australia Forum Administrator #9
My guess from the error message is that something to do with foreign keys is now being enforced more.

One solution, that you probably won't want, is to delete the old mapper database and let it make a new one. (Of course, just rename/backup it, just in case).


Another thing you could try is turning foreign key checking off.

I'm not sure which version you have exactly, but if you look in the mapper plugin you should be able to find a line like this:


  
  -- open databases on disk 
  db    = assert (sqlite3.open(GetInfo (66) .. Trim (WorldAddress ()) .. "_" .. WorldPort () .. ".db"))
  


After that (after the database is opened) add this line:


dbcheck (db:execute ("PRAGMA foreign_keys = OFF;"))


Then reload the plugin and try again. This may simply lead to a different error, but it is worth trying.
Australia Forum Administrator #10
Or if there is a line like this:


create_tables ()    -- create database structure if necessary


Do it after that, because create_tables turns foreign key checking back on.
USA #11
Starcomet said:

What is your suggestion for fixing it Meerclar? I am fine with using this older version, but I think it would be best to update to the newest version.

I'm honestly not familiar enough with the changes from the library Nick was using prior to the upgrade to offer even as good a solution as Nick has already offered. I was more pointing out the likely cause for working properly on the older version but not the 2 latest releases in the fairly likely event someone else from Achaea comes along with the same issue in the near future.
Australia Forum Administrator #12
I've just tried it on Achaea and had the same problem.

Edit the plugin, find the line with the foreign key restraint on it, and remove it. Also remove the comma from the previous line like this:


  CREATE TABLE IF NOT EXISTS exits (
      exitid      INTEGER PRIMARY KEY AUTOINCREMENT,
      dir         TEXT    NOT NULL, -- direction, eg. "n", "s"
      fromuid     STRING  NOT NULL, -- exit from which room (in rooms table)
      touid       STRING  NOT NULL, -- exit to which room (in rooms table)
      date_added  DATE              -- date added to database
    );


Close MUSHclient, delete the database file (achaea.com_23.db) and then try again.
USA Global Moderator #13
Foreign key constraints are kinda useless anyway.