Sign in to follow this  
Adambean

Unable to pick up any item (without GM >= 2), can't move any BSB content at all

Recommended Posts

Hello,

 

I've run into a problem in game of which only appears to impact me on one world.

 

  • I'm unable to take any item from the ground as I'm "carrying too much" unless I set my GM power to 2 or higher. (I usually play at level 1.)
  • I'm unable to move anything from bulk storage using the "as many as possible" option. -- Exact quantities must be typed.
  • I'm unable to take anything from bulk storage at all unless I set my GM power to 2 or higher.
  • Dropping items works fine, though then I can't pick them up again.
  • Tested dropping literally everything (of which is allowed to be dropped), bringing equipment weight down to just 3 kG, still can't get anything.

 

My body strength is currently 59.31 offering a max carrying weight of 415 kG, which seems very hard to believe but this shouldn't be a weight issue. There are also way less than 100 items in my inventory (including back back) so I don't know why this would be a count issue either. Also when carrying next to nothing stamina seems to drop very quickly, only able to walk approximately 14 paved tiles before it's completely drained. (Stamina skill level is 47.14, food/water both full.) Finally riding a horse has no forward/backward movement at all, unless hitched to a large cart or similar (that works normally). Sailing works fine.

 

This server used to run bdew's Movement Tweaks mod and Webba's Bulk Storage Transfer Limits mod but no longer does. (Odd properties left over?)

 

At this point I'm thinking that there must be some odd property on my player record causing this. It's as if the server thinks I'm holding onto something very heavy but invisible to my inventory list. -- The only oddity I've noticed so far is that all players have property `MOVEDINV` set to 1 whereas it's 0 for me, though I did shut down the server, set it to 1, then joined again but it just resets to 0.

 

Any suggestions where I can look to diagnose this issue further?

 

Edited by Adambean

Share this post


Link to post
Share on other sites

What mods are you actually running now? none of the 2 mods you mentioned use any persistent effect that could stay after you removed them.

 

It's probably some other out of date mod interfering with bulk container mechanics.

Share this post


Link to post
Share on other sites

Currently active:

 

actiondemo
announcer
AshProduce
betterdig
betterfarm
bindmod
chestclaim
CopyItems
cropmod
customRMImod
deedmod
ebonywandmod
FireBurnTime
fixguards
gmcommands
harvesthelper
httpserver
hwportals
inbreedwarning
JPWM_ModGuiManager
movetocenter
NoHolyGround
sacrificemod
scriptrunner
serverfixes
servermap
serverpacks
serverplayercounter
ServerTweaks
setheight
SinduskLibrary
timerfix
TreasureHunting
waxed

 

Come to think of it I don't think Ulviirala's "NoHolyGround" ever worked. That can go. (Sindusk provides this now.)
I have no custom scripts, so "scriptrunner" can go.
Hmm... "serverfixes", that's not Sindusk's one, and I can't remember where that came from. (Class "org.gotti.wurmunlimited.mods.serverfixes.ServerFixesMod") Better remove that.

Share this post


Link to post
Share on other sites

Seems like the most probable options is: Ebonywandmod but I don't have it so not sure what it does.

 

NoHolyGround does have some different functionality than what is in Servertweaks, it also allows founding of settlements near altar which didn't seem to work with that line of code in the servertweaks mod as well as allowing the founding of villages when there are aggressive creatures still within the vicinity. You'll get messages stating the mobs need to be cleared out first, and random village is still under siege while resizing iirc without it.

Share this post


Link to post
Share on other sites

Ebony wand mod is just a way to pull back on the oddities of being a GM at all, e.g. the instant mining.

 

Server mod: Ebony wand 2.0

 

Not been maintained for a while now though so it doesn't cover everything, and now less relevant with the RMI tools allowing us to switch power level at runtime.

 

 

 

Edit: Oh wait, ServerFixes came from Ago. I better keep that one.

Edited by Adambean
ServerFixes

Share this post


Link to post
Share on other sites

Doesn't look like the Ebony wand mod was the issue.

 

Resolved this with some tips from KeeNAN. It turned out that items I was selling to a salesman (world one, not personal) were not having their `ownerid` updated to reflect the salesman instead of me.

 

----

 

For anyone else having this problem you will need the following:

  • An SQLite editor. (My favourite is SQLite Studio.)
  • Your Wurm server to be shut down.
  • Direct file system access to your Wurm server SQLite database files.
    • These are within the world folder from your Wurm server root, then in the "sqlite" folder as ".db" files.
    • If you see ".db-shm" (shared memory) or ".db-wal" (write-ahead log) files your Wurm server has likely not shut down fully yet.

To find the issue first find your Wurm ID. You can find this in the `wurmplayers` database:

  1. Open the PLAYERS table.
  2. Click the Data tab.
  3. If your player list is very long put your in game name into the Filter data text box (2nd toolbar) then press Enter.
  4. In the row for your player copy the contents of the WURMID column, e.g. "100686085376".

Next you will need to find out all of the items Wurm thinks are in your possession right now. You can find this in the `wurmitems` database:

  1. Open an SQL editor by pressing ALT+E, or clicking the button for it in the toolbar. (2 left of that "fx" button.)
  2. Paste in query:
    SELECT WURMID, NAME, OWNERID, PARENTID FROM ITEMS WHERE OWNERID = YOUR_WURMID ORDER BY NAME ASC;
    Replace YOUR_WURMID with the WURMID value you copied from the `wurmplayers` database earlier.
  3. Press F9, or click the play button in the 2nd toolbar to execute this query.

At this point I immediately noticed a huge amount of items I knew I had sold to a salesman and were definitely not showing up in any of my own inventory windows/trees. One thing I took interest in for these rows is the PARENTID value, particularly because that ID wasn't appearing in any of the WURMID columns of this result set. Copy that PARENTID for later...

 

As I know these were traded to a salesman I verified this by finding that creature in the `wurmcreatures` database:

  1. Open the CREATURES table.
  2. Click the Data tab.
  3. Paste in the PARENTID you copied from the previous query into the Filter data text box (2nd toolbar) then press Enter.

This returned 1 record showing the salesman I knew I always sold stuff to. The INVENTORYID column of this salesman ID was an exact match for the suspicious PARENTID from the items table. Copy the salesman's WURMID for later...

 

Finally to resolve this you need to transfer ownership of all the items you sold from yourself to the salesman. You do this back in the `wurmitems` database:

  1. Open an SQL editor by pressing ALT+E, or clicking the button for it in the toolbar. (2 left of that "fx" button.)
  2. Paste in query:
    UPDATE ITEMS SET OWNERID = SALESMAN_WURMID WHERE PARENTID = SALESMAN_INVENTORYID AND OWNERID != SALESMAN_WURMID
    Replace SALESMAN_WURMID with the WURMID value you copied from the `wurmcreatures` database earlier.
    Replace SALESMAN_INVENTORYID with the PARENTID value you copied from the `wurmitems` database earlier.
  3. Press F9, or click the play button in the 2nd toolbar to execute this query.

In my case there were 567 affected rows changed.

 

Disconnect SQLite Studio from all (3) databases you opened, start up your Wurm server, and check yourself. -- I was completely fine at this point.

 

----

 

My final thoughts why this problem happened in the first place. (Wurm bug? Plug-in interference?) Not everything I had sold to this salesman still had me as the owner ID, just a significant quantity of it. This could have been a bug with a specific version of Wurm. (1.8x as this issue is recent?) Who knows! I'll try selling some diamonds to the salesman now that I'm on 1.9.1.5 and see whos owner ID the item ends up with.

Share this post


Link to post
Share on other sites

This is something which could also happen due to bad synchronisation while multi threading.

Make sure that in all wurm.ini files the following entries are set to false:

 

USE_SCHEDULED_EXECUTOR_TO_UPDATE_ITEM_OWNER_IN_DATABASE=false
USE_SCHEDULED_EXECUTOR_TO_UPDATE_ITEM_LASTOWNER_IN_DATABASE=false
USE_SCHEDULED_EXECUTOR_TO_UPDATE_ITEM_PARENT_IN_DATABASE=false

Share this post


Link to post
Share on other sites

Those 3 settings are definitely set (as false). I checked the INI today when Bdew mentioned it on Discord, the INI file for the world was last changed on 2nd Feb 2018. I recall doing that to rectify a different issue whereby items I had sold came back in my inventory after re-logging. That was years ago though, and this problem has been much more recent.

 

Not all items the salesman had in his inventory still had my owner ID too. A lot of it had transferred correctly. Looking at the items that had this problem many of them were mauls and shields I know I had made this year on version 1.8.x.x.

Edited by Adambean

Share this post


Link to post
Share on other sites

1 month on and into 1.9 I can pretty safely say that this was a bug in 1.8 or earlier. -- I've not had this problem since manually correcting the database.

Share this post


Link to post
Share on other sites

Heh scratch the above. I've checked this again as I've suddenly been unable to pick anything up, this problem still happens on 1.9.1.6. -- Owner ID does not update to the trader.

 

[Edit] Happens in 1.9.2.7 too.

Edited by Adambean

Share this post


Link to post
Share on other sites

I trust then this is another bug for the list that is never going to be looked at. :)

  • Like 1

Share this post


Link to post
Share on other sites

Update: This is somewhat workaround-able with an external script to periodically run an SQL query using the included SQLite binaries.


On the plus side you won't need to shut down your server, however effected players will need to reconnect to refresh their item ownerships. (I don't see why teleporting in game would do the trick. A reconnect will be necessary.) You could also schedule this script to run periodically thoughout the day (4-6 times a day should be enough) so that impacted players get fixed automatically "soon enough".

 


First you need to gather a list of salesman

  1. Open a command prompt or terminal to your WU server world's SQLite directory.
    • Windows e.g.: "C:\Games\Wurm Unlimited\Creative\sqlite"
    • Linux e.g.: "~/wu/Creative/sqlite"
  2. Execute the following command to gather a list of salesman in this world:
    • Windows: sqlite3 wurmcreatures.db "SELECT NAME, WURMID, INVENTORYID, KINGDOM FROM CREATURES WHERE NAME = 'Salesman' ORDER BY WURMID ASC;"
    • Linux: ./sqlite3 wurmcreatures.db "SELECT NAME, WURMID, INVENTORYID, KINGDOM FROM CREATURES WHERE NAME = 'Salesman' ORDER BY WURMID ASC;"
  3. You should see a tabular response such as this:
    Salesman|1651941031169|845793807970323|3
    Salesman|1652209466625|845931246923795|1
    Salesman|1653216099585|846446642999315|2
    Salesman|6875661450497|3520338662666259|4
  4. The columns will respectively be the NPC name (obviously), its wurm ID, its inventory ID, and its kingdom. (0 = none, 1 = MR, 2 = JK, 3 = HOTS, 4 = FI) The kingdom may not be necessary, this may just help you identify which salesman is which.

At this stage you could identify if any of your salesman have been sold an item but haven't fully received ownership of it with this command:

  • Windows: sqlite3 wurmitems.db "SELECT WURMID, NAME FROM ITEMS WHERE PARENTID = 845931246923795 AND OWNERID != 1652209466625 ORDER BY NAME ASC;"
  • Linux: ./sqlite3 wurmitems.db "SELECT WURMID, NAME FROM ITEMS WHERE PARENTID = 845931246923795 AND OWNERID != 1652209466625 ORDER BY NAME ASC;"

Now we can create a command file to correct such items in bulk.

 


For Windows servers

  1. In your WU server world's SQLite directory create a plain text file called "maintenance.cmd", and open it in your favourite plain text editor (such as Notepad or Sublime Text).
  2. Paste in the following content:
    @ECHO OFF
    ECHO Fixing salesman item ownership...
  3. For each of your salesman you'll need to add the following line, though replace "<INVENTORY_ID>" and "<WURM_ID>" for the salesman's inventory ID (column 3) and Wurm ID (column 2) from the table you obtained previously:
    sqlite3 wurmitems.db "UPDATE ITEMS SET OWNERID = <WURM_ID> WHERE PARENTID = <INVENTORY_ID> AND OWNERID != <WURM_ID>;"
  4. So for my four salesman I've got:
    sqlite3 wurmitems.db "UPDATE ITEMS SET OWNERID = 1651941031169 WHERE PARENTID = 845793807970323 AND OWNERID != 1651941031169;"
    sqlite3 wurmitems.db "UPDATE ITEMS SET OWNERID = 1652209466625 WHERE PARENTID = 845931246923795 AND OWNERID != 1652209466625;"
    sqlite3 wurmitems.db "UPDATE ITEMS SET OWNERID = 1653216099585 WHERE PARENTID = 846446642999315 AND OWNERID != 1653216099585;"
    sqlite3 wurmitems.db "UPDATE ITEMS SET OWNERID = 6875661450497 WHERE PARENTID = 3520338662666259 AND OWNERID != 6875661450497"
  5. Save this file. If you have a backup roster be sure to include this file.

You can run it in a command prompt to check it works, and verify it by either (re)connecting to the server if it were you impacted, or use the previous "SELECT WURMID, NAME FROM ITEMS WHERE PARENTID..." query.

 

To schedule this with Windows Task Scheduler:

  1. Open the Task Scheduler. (Easily found by typing this in the Start menu search, or go to Control Panel then Administrative Tools.)
  2. Select Task Scheduler Library in the tree to the left.
  3. Right click the white background and choose Create New Task.
  4. Give your task a sensible name, e.g. "Wurm Unlimited: Creative world maintenance"
  5. Set the user in the security options to the same user that runs your Wurm Unlimited game, and opt Run whether user is logged in or not, and tick Do not store password.
  6. Create a Trigger to your preference, but perhaps it'd be sensible to choose Daily then repeat task every 3 hours or 4 hours. (Type in the interval.)
  7. Create an Action:
    • Program script needs to point to the "maintenance.cmd" file, e.g. "C:\Games\Wurm Unlimited\Creative\sqlite\maintenance.cmd". (Be sure to "quote it" if your directory path contains spaces.)
    • Leave the arguments empty.
    • Start in needs to be the directory path where "maintenance.cmd" is located, e.g. "C:\Games\Wurm Unlimited\Creative\sqlite". (DO NOT "quote it" even if it has spaces.)
  8. All other settings can likely be left as default unless you've got some preference.
  9. Save this task.

You may wish to export this task for backup as an XML file by right clicking it and choosing that. A sensible location would be alongside "maintenance.cmd" then include it in your backup roster.

 


For Linux servers

  1. In your WU server world's SQLite directory create a plain text file called "maintenance.sh", and open it in your favourite plain text editor (such as Kate or Sublime Text).
  2. Paste in the following content:
    #!/bin/bash
    DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

    printf "Fixing salesman item ownership...\n"
  3. For each of your salesman you'll need to add the following line, though replace "<INVENTORY_ID>" and "<WURM_ID>" for the salesman's inventory ID (column 3) and Wurm ID (column 2) from the table you obtained previously:
    "${DIR}/sqlite" "${DIR}/wurmitems.db" "UPDATE ITEMS SET OWNERID = <WURM_ID> WHERE PARENTID = <INVENTORY_ID> AND OWNERID != <WURM_ID>;"
  4. So for my four salesman I've got:
    "${DIR}/sqlite" "${DIR}/wurmitems.db" "UPDATE ITEMS SET OWNERID = 1651941031169 WHERE PARENTID = 845793807970323 AND OWNERID != 1651941031169;"
    "${DIR}/sqlite" "${DIR}/wurmitems.db" "UPDATE ITEMS SET OWNERID = 1652209466625 WHERE PARENTID = 845931246923795 AND OWNERID != 1652209466625;"
    "${DIR}/sqlite" "${DIR}/wurmitems.db" "UPDATE ITEMS SET OWNERID = 1653216099585 WHERE PARENTID = 846446642999315 AND OWNERID != 1653216099585;"
    "${DIR}/sqlite" "${DIR}/wurmitems.db" "UPDATE ITEMS SET OWNERID = 6875661450497 WHERE PARENTID = 3520338662666259 AND OWNERID != 6875661450497"
  5. Add a blank line after this, then end the file with:
    exit 0
  6. Save this file. If you have a backup roster be sure to include this file.

To schedule this with Crontab:

  1. Open the Crontab with command: crontab -e
  2. Add a line with the schedule of your choice, for example to either run this every 3 or 4 hours (pick one), and replace "<user>" for the username running this script, and the path, obviously:
    0 */3 * * * /bin/bash /home/<user>/wu/Creative/sqlite/maintenance.sh
    0 */4 * * * /bin/bash /home/<user>/wu/Creative/sqlite/maintenance.sh
  3. Save your crontab.

If you'd like to backup your crontab it'd be sensible to do this with command: crontab -l > ~/.cron

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this