How To Recover: Subscribing To Workshop -> Temp Dump 0xc0000005 Access Violation

Discussion in 'Technical Reports' started by Dakota, May 21, 2019.

  1. Dakota

    Dakota Member

    Joined:
    May 13, 2018
    Messages:
    81
    Likes Received:
    37
    So many of these reports... If you subscribe to new Workshop items (in my case Scenarios) you risk scorching your Train SIm installation. I know what's happening now (after a couple of days systematic and detailed analysis).

    Short Story:
    1. Subscribe to Workshop scenario(s). The more you do at one time the higher your risk!
    2. Try to open TS. It may die during initialization, or more commonly shortly after you see the Main Menu, boom! Temp Dump with 0cC000005 popup.
    3. Subsequent attempts to open TS will result in a nearly immediate Temp Dump and popup.
    What's Happening?

    When you subscribe to a Workshop item, Steam puts it into its workshop folder that is shared between all installed games. This process always succeeds. Each time TS starts, it looks at its own list of installed Workshop items vs the stuff Steam has in its shared area. If there is something new, TS will "auto-install" it from the Steam area into its own workshop area. This process of "auto-install" happens in the background and in parallel with the startup of TS, and it is this process that is unreliable. Sometimes, and I can't see any pattern to it, the installation process results in TS' copy of the workshop data being plainly corrupted. For scenarios (for example) a file called ScenarioProperties.xml is read from the Steam area, and then it is altered by TS which substitutes "real" values for "placeholders" in the original from the workshop. This is what randomly fails. Once TS has corrupted a workshop item during installation, Train Simulator is 100% dead.

    I have seen no pattern to the corruption. Sometimes garbage data and/or characters will be embedded in strings (the ones that are substituted by TS during installation). I've even seen a case where an entire chunk of 15-20 lines of the original ScenarioProperties.xml are simply missing from the "installed" one in TS. Clearly TS' startup process of "installing" the XML file is unreliable. I have reproduced this many times over the last week or so and I clearly understand what is happening, I just don't know why! ANd this has been happening for ages, based on the reports I have seen here and elsewhere over the last year or so.

    How to Mitigate the Problem - Don't subscribe to more than one Workshop item at once. It's really hazardous to install an entire collection.

    How to Recover from a TS Workshop Corruption
    1. Let's say you installed a Workshop Scenario. Open the File Explorer and navigate to C:\Program Files (x86)\Steam\steamapps\common\RailWorks\Content\Routes
    2. In the File Explorer's Search box (upper right) type ScenarioProperties.xml. You will get a lot of these files, one for each workshop scenario.
    3. Now sort this list by Date Modified descending with most recent at the top. The one at the top will most likely be the corrupted one.
    4. Right-click on this entry in the list and choose Open File Location. You should see something like this: Snap6.jpg
    5. In the above example, in the location field at the top of the Explorer, click Scenarios. This will put you in the scenarios folder of the correct route. Again sort the list by Date Modified descending. Now you should see the (e.g.) 8bb168eb-68b9-4c97-90d5-6dd340e884e9 folder at the top (newest scenario folder). Delete it (delete the e.g. 8bb168eb-68b9-4c97-90d5-6dd340e884e9 folder). This deletes the corrupted scenario.
    6. Keep the File Explorer open as it is. Now start TS. It will see that it needs to install this Scenario from the workshop. If it still dies, then delete the next oldest scenario folder, etc. If you have to delete more than 2-3 to get TS to start, then you should unsubscribe from those scenarios in Steam so your odds for getting them all to successfully install in TS will improve :)
    7. Let it initialize, then let it sit at the main menu for at least 30 seconds (enough time for the background installation process to complete), then try to enter Drive > Workshop. If you see a brief "Installing Workshop Items" then you're good and this time it succeeded.
    8. If you get another TempDump, go back to that File Explorer you left open in step 6. and delete the scenario folder again. It will still be at the top of the date-sorted list.
    9. Repeat (delete, restart) until you can run TS. It may take a few tries. There is nothing you can do (AFAIK) to "make" it install the scenario successfully. Just keep trying. Eventually it will succeed.
    For routes instead search for RouteProperties.xml. If you delete an entire route folder, though, all of the scenarios for that route will also be auto-installed and your chances for success are lowered (at least one will probably get corrupted). In this case unsubscribe from all of the scenarios for that route, then unsubscribe from the route, and delete the Routes\xxx-xxx-xxxx folder to allow TS to start. then start with subscribing to the route, keep trying until you get a good Route install, then once for each scenario, repeat until successful.

    I know this is complicated ... I just did my best to explain it. It's probably easier to actually do after you've dome it a few times. Of course if you're careless you could scorch your whole TS installation so be careful.
     
    Last edited: Jul 23, 2019
    • Helpful Helpful x 3
  2. ARuscoe

    ARuscoe Well-Known Member

    Joined:
    Apr 9, 2018
    Messages:
    10,832
    Likes Received:
    10,482
    If it's the mixture between the TS startup routine (which does check the database so could be locking the files which are trying to be installed at the same time, creating the conflict) another thing you can do is having TS running and at the scenario selection screen for a non-connected route. This way the program won't be accessing the same files at the time. THEN go into the workshop and do your subscription and steam should still install the route or scenario in the background, giving you a pop up in the top right when it's complete

    File locks can cause all sorts of issues, so if you've shown it to be a problem with starting up TS whilst installing items, this would be my bet
     
    • Like Like x 1
  3. Dakota

    Dakota Member

    Joined:
    May 13, 2018
    Messages:
    81
    Likes Received:
    37
    I'm not subscribing then immediately running TS2018. I thought of the conflict between Steam's workshop (and it's cache of files for subscribed scenarios) and TS2018 starting up and finding a possibly partially downloaded workshop item. This can't happen, because the workshop cache items are single files, giant zipfiles. For example C:\Program Files (x86)\Steam\steamapps\workshop\content\24010\1213109480\scnr_48da92e6-11d4-4402-9561-64e180194e68 is a scenario on the workshop cache.

    I subscribed way before, like an hour. I then let it install into TS then tried. Boom. I deleted the installed scenario in TS and let TS again install it. Boom. Finally on the nth try it was OK. I had taken the scnr_xxx.zip in the workshop, copit it out then unzipped it into folders. That allowed me to see the differences between files (using a powerful "diff" tool Araxis Merge I could scan every file in the scenario even the .ap and .bin ones. The installation process only modifies ScenarioProperties.xml. The rest come out of the workshop cache scnr_...zip unmodified.

    I got to where I simply compared the original ScenarioProperties.xml from the workshop cache (which is always correct) and the installed one in TS Route. I can immediately see the corrupted ones versus the ones that are modified in accordance with the installation.

    Maybe there is a locking botch somewhere in there, but it is unrelated to the subscription process in the Workshop. That had all occurred well before my tests, and the contents of the stuff from the Workshop are always correct.
     
  4. Dakota

    Dakota Member

    Joined:
    May 13, 2018
    Messages:
    81
    Likes Received:
    37
    PS: I am on a 64 bit system and am running TS2019 / 64. I saw a post that advised that the 64 bit version is having problems. Maybe this is one of them. I will switch to editing in 32 bit mode.
     
  5. Nigel Kendal-Ward

    Nigel Kendal-Ward New Member

    Joined:
    Dec 1, 2018
    Messages:
    5
    Likes Received:
    1
     
  6. Nigel Kendal-Ward

    Nigel Kendal-Ward New Member

    Joined:
    Dec 1, 2018
    Messages:
    5
    Likes Received:
    1
    As far as I can recall,this as mentioned to Dovetail as far back as Train Sim 2015, and their attitude seems to be "if you download free stuff, it can't be any good. This does a disservice to many who write these scenarios.
    But for a game developer to deny ALL responsibility for writing and releasing such a buggy program in the first place beggars belief. First they screw about with Flight Simulator, rewrite it and when the going gets tough, Dovetail abandon it. I wonder if Train Simulator is going the same way, now that Train Sim World has been allowed to escape?
     
    • Like Like x 1
  7. Smokebox

    Smokebox Active Member

    Joined:
    Dec 10, 2016
    Messages:
    105
    Likes Received:
    98
    • Like Like x 2
  8. Smokebox

    Smokebox Active Member

    Joined:
    Dec 10, 2016
    Messages:
    105
    Likes Received:
    98
    By the way, I strongly recommend that everyone who gets Access Violation when trying to start TS2019, while it says it's "Updating Scenario Database", raise a ticket with DTG support (https://dovetailgames.kayako.com/Tickets/Submit) and mention this thread.
     
    • Like Like x 1
  9. Dakota

    Dakota Member

    Joined:
    May 13, 2018
    Messages:
    81
    Likes Received:
    37
    Smokebox, I couldn't agree more. There is a new one posted today here in the Bugs forum and you should see the (un) helpful replies.
     
  10. Dakota

    Dakota Member

    Joined:
    May 13, 2018
    Messages:
    81
    Likes Received:
    37
    The hits just keep on coming. This just has to be a cross-thread timing issue, no thread-lock on the data. In my opinion this is a show-stopper class bug. I realized that my title should indicate that recovery instructions are included in the OP so I changed the title.
     
    Last edited: Jul 23, 2019
  11. Alicatt

    Alicatt New Member

    Joined:
    Dec 9, 2016
    Messages:
    18
    Likes Received:
    11
    This helped me today when I got an access violation on start up of TS2019 64bit, deleted the scenario and route that I had just subscribed to. First I unsubscribed from the scenario and route then deleted the files/folders and restarted TS2019 and it worked, so cleared cache exited and then re subbed to the route and let it download again … and it works :)
     
  12. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    8,420
    Likes Received:
    2,674
    If I download a scenario that I like and I might run more than once I will clone the scenario and then unsubscribe the original scenario.
    Seems to work as I don't, touch wood, suffer from the Access Violation problem related to Workshop Scenarios.

    Peter
     
  13. Alicatt

    Alicatt New Member

    Joined:
    Dec 9, 2016
    Messages:
    18
    Likes Received:
    11
    Thanks for your info 749006, but it does not really help in that TS2019 would not open to allow that, it crashed with the access violation long before it got to the menu, and it crashed with both the 32bit and 64bit versions.
     
  14. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    8,420
    Likes Received:
    2,674
    Did you unsubscribe from any Workshop Scenarios/Routes - you can do that thru the Steam Client

    Peter
     
  15. Alicatt

    Alicatt New Member

    Joined:
    Dec 9, 2016
    Messages:
    18
    Likes Received:
    11
    Yes I did unsubscribe first, but that did not allow TS to run either, it was after that that I came here looking for a solution and led me to the above solution which did allow me to delete the offending workshop items which let TS run, I've since re subscribed to the items individually and re-downloaded them and TS runs just fine and I have been enjoying my run from Oban to Edinburgh Waverly :)
     
    • Like Like x 1
  16. Wikkus

    Wikkus New Member

    Joined:
    May 1, 2019
    Messages:
    2
    Likes Received:
    1
    This is pure gold! Thank you, OP! +severalmillion :D

    R.
     
    • Like Like x 1
  17. Dakota

    Dakota Member

    Joined:
    May 13, 2018
    Messages:
    81
    Likes Received:
    37
    I really wish I knew what the transfer process does. Numeric d:id values change seemingly randomly, lat/long values change ... I've diffed the before and after on successful subscriptions. I would make a program that reads the ScenarioProperties.xml from the workshop zipfiles and creates clean ones in the route\x-x-x-\scenarios\y-y-y\ScenarioProperties.xml. It's easy to tell the ones that get scorched when the new workshop items are processed during RailWorks.exe startup. The ScenarioProperties.xml files are riddled with trash and cannot pass XML validation.
     
  18. Peter Hayes

    Peter Hayes Well-Known Member

    Joined:
    Dec 9, 2016
    Messages:
    787
    Likes Received:
    318
    If you download and install WS scenarios manually you will rarely see a scenario db OOM error when TS starts.
    This is the usual error that causes the OOM:
    In the scenarioproperties.xml file, you will probably see this line of code
    [Scenario GUID reading ScenarioProperties.xml failed – ‘.’, hexadecimal value 0x00, is an invalid character. Line xx, position xx]
    If this line is present, and particularly if it is a WS scenario, then the scenario extraction into TS has gone wrong. and the scenario should be unsubscribed and deleted.

    Unsubscribe and delete Workshop Items – the correct way
    · If it is to do with workshop scenarios and/or a corrupt scenario database try this:
    · This is for errors that occur where TS20XX is loading, checking, verifying the scenario database on start–up.
    NB: Verifying the game files won't fix a WS scenario problem.
    1. Open Steam and highlight Train Simulator.
    2. Click on The Workshop Tab
    3. Click Browse then Subscribed items.
    4. Individually unsubscribe each scenario or choose - Unsubscribe all to get rid of the lot.

    TS-Tools Option:
    · Just because you have unsubscribed WS scenarios via STEAM does not mean that they have been removed from your computer.
    · Invest in the FREE TS-Tools and remove them route by route - they are colour coded - blue.

    Additional method to check:
    1. To delete all WS scenarios from your computer, navigate to \STEAM\steamapps\workshop\content\24010 and delete every file and sub-folder in that folder.
    2. DO NOT DELETE the \24010 folder itself
    3. (If you want to keep any or all scenarios then copy the contents first to a safe place before deleting the files and then reinstall once your error is fixed.

    Rebuilding the Scenario Database
    Even after removing all WS Scenarios you may have a "corrupt" scenario database and that can easily be rebuilt:
    Close TS and navigate to: \STEAM\steamapps\common\RailWorks\Content and delete/rename the following 2/4 files:
    · SDBCache.bin;
    · SDBCache.bin.MD5;
    · RVDBCache.bin; (optional)
    · RVDBCache.bin.MD5; (optional)
    Restart steam and TS
     
    Last edited: Jul 14, 2021
  19. KodiakJac

    KodiakJac Active Member

    Joined:
    Jul 30, 2022
    Messages:
    142
    Likes Received:
    78
    This post and thread is brilliant!

    And I have a related problem. After subscribing to a Workshop scenario, I got the standard "Installing Workshop Items" pop-up a few minutes later. But now I keep getting the "Installing Workshop Items" pop-up over and over again even though the scenario was successfully installed.

    So, I unsubscribed from the Workshop scenario in TSC which started this problem, and it appears to be a successful unsubscribe (the scenario no longer appears in TSC). But the "Installing Workshop Items" pop-up continues to appear every time I launch TSC. So, I unsubscribed from the second to the last Workshop scenario I had installed before this pop-up problem started, but I'm still getting the "Installing Workshop Scenario" pop-up every time I launch TSC (and also every 5 or 10 minutes as I'm navigating around inside TSC).

    Any ideas on how to fix this problem? TSC appears to be trying to install an infinite number of Workshop scenarios. This has been going on for several days now.

    Thanks! :)
     
  20. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    8,420
    Likes Received:
    2,674
    Does the pop-up cause a problem with running the game - if not then ignore it.

    Having installed a few routes and scenarios I get this "Installing Workshop Items" pop-up.
    It does not stop me running the routes or scenarios.

    Although you have unsubscribed from a workshop scenario it is still on your computer until you physically remove it.
     
  21. KodiakJac

    KodiakJac Active Member

    Joined:
    Jul 30, 2022
    Messages:
    142
    Likes Received:
    78
    No, it doesn't seem to be hurting anything. Was just wondering if there was an easy fix for it, and hoping it is not a harbinger of worse problems to come with the Workshop. I've lived through two TSC killing events with the Workshop as described in the OP over the past year, and not knowing about this thread, had to re-install Train Simulator. But knowing you've had this continuous pop-up helps me in knowing it's not just my TSC installation. Thanks!
     
  22. torfmeister

    torfmeister Guest

    Here's a method to get around this issue - installing WS content without TS syncing and without file corruption.

    Brief description:

    1. TS must not be running
    2. Subscribe your items via Steam workshop page (multiple if you wish - file corruption only happens at the time TS is started because it manipulates each item's RouteProperties.xml /ScenarioProperties.xml by adding tags to the file)
    3. Open the folder Steam\steamapps\workshop\content\24010\ with a file manager like 7zip (opens any archive)
    4. Click on each item, it comes as a zip or a legacy.bin (which 7zip also opens like a normal folder)
    5. Click through until you see the folder "Content" and copy that to your RailWorks folder.
    6. If everything is copied, delete Steam\steamapps\workshop\content\24010\ contents.
    7. Go to Steam Library, TS->Properties->Workshop and unsubscribe everything.
    8. Fire up TS, and the Workshop items will show up like any scenario you added from a 3rd party.

    Pros:
    - no file corruption
    - no time consuming Workshop syncing (TS scans all scenarios for WS tags, compares them with the contents of the Steam WS content folder, restores changes
    - You can access scenario editor normally from ingame (normally WS items are protected from manipulation, World Editor is greyed out in the ingame menu)
    - You can have as many WS items installed as you wish without slowing down startup
    - If the author decides to remove the WS content, it stays on your installation
    - you can archive your favourite WS stuff easily by copying the mentioned steam 24010 workshop folder after subscribing and before cleaning

    Cons:
    - Filter in the Drive menu (Official/Workshop) does not work, because TS doesn't know they're WS items as we've skipped the erraneous tagging process

    Using a manager like 7zip file manager with two views, this operation is quickly done.
     
    Last edited by a moderator: Jan 22, 2023
    • Like Like x 1
    • Helpful Helpful x 1
  23. torfmeister

    torfmeister Guest

    Adding to this so you see what's happening.

    First image is the ScenarioProperties as it is downloaded from the Workshop.
    Second image shows the tags that get added when you let TS handle installing workshop content.

    2023-01-22 21_21_32-.png 32.png
     
    • Helpful Helpful x 1
  24. Peter Hayes

    Peter Hayes Well-Known Member

    Joined:
    Dec 9, 2016
    Messages:
    787
    Likes Received:
    318
    Torf
    That is the method I use and I place a shortcut to the steam\steamapps\workshop\content\24010\ folder on my desktop plus a shortcut to the Railworks folder - this makes the process pretty fast and easy.
    In TS-Tools they appear as Standard Scenarios. (no longer colored 'blue')
    To keep a copy of any WS scenario I just copy the zip file from the 24010 folder to a folder (called workshop scenarios) on another drive.
    You can still get WS scenarios that won't run for any reason, but not usually at startup - only when you access the scenario via the main menu, so it's easy to know which scenario won't run on your PC.
    I thought that WS OOM error was not caused by the scenario per se but by the download interface between TSC and the workshop becoming corrupted on occasion.
     
    • Helpful Helpful x 1
  25. KodiakJac

    KodiakJac Active Member

    Joined:
    Jul 30, 2022
    Messages:
    142
    Likes Received:
    78
    This is game changing information, Torf! Thank you so much for this! This is fantastic! :D

    I understand what you've explained exactly. So, right now I've got about two dozen Workshop scenarios installed in the traditional manner and I want to start over and use the method you've described going forward. I'm hoping not to have to re-install TSC to get rid of the continuous "Installing Workshop Items" pop-up. Any thoughts on how to do that? Unsubscribing doesn't seem to help.

    I'll also go back and read the OP in this thread and see if that will lead to a solution in starting over. And if not, it is going to be worth it to re-install TSC one more time to start over with a clean install and then use the method you've described for installing Workshop scenarios going forward.

    Thanks! :)
     
    Last edited: Jan 22, 2023
    • Like Like x 1
  26. torfmeister

    torfmeister Guest

    Kodiac, there should be no need to reinstall.

    Unsubscribe everything via Steam Game props, and make sure the steamapps\workshop\24010 folder is empty. If there's anything left in there, delete it. After that delete the appworkshop_24010.acf file (which actually is the list of what you've subscribed) to make sure everythings clean.

    Use NameMyRoute.exe to find any leftover scenarios which could be broken, and delete these manually from Content\Routes\...

    Then apply my procedure to reinstall your favourites.
     
    • Helpful Helpful x 1
  27. KodiakJac

    KodiakJac Active Member

    Joined:
    Jul 30, 2022
    Messages:
    142
    Likes Received:
    78
    This worked, Torf! I'm no longer getting the perpetual "Installing Workshop Items." Thanks so much for saving me a potential re-install of TSC! :D



    Next, I'm going to use NameMyRoute.exe as you suggest. Something new to learn there :)

    Cheers!
     
  28. KodiakJac

    KodiakJac Active Member

    Joined:
    Jul 30, 2022
    Messages:
    142
    Likes Received:
    78
    Ok, next question :)

    I ran namemyroute.exe but I don't know what I'm looking at...

    namemyroute.jpg

    1. I see route names I recognize that have a "+" allowing me to expand them.

    2. I see lines saying "missing RouteProperties.xml" that don't have a "+" and can't be expanded.

    3. And then I see lines saying "missing RouteProperties.xml" that have a "+" and can be expanded. And those fall into two categories...
    a) When expanded I see scenario names
    b) When expanded I see "missing ScenarioProperties.xml"

    When you have the time, could you please explain what I'm looking for here. I feel like I'm back in programming school...lol By now, I think I owe you a steak dinner for helping me with all this! If you ever travel to Tennessee, let me know and I'll make good on my offer! :D

    Thanks, Torf!
     
  29. torfmeister

    torfmeister Guest

    Offer accepted :)

    NameMyRoute.exe is pretty old, I think it was already part of the RailWorks DevTools.

    It cannot read the contents of .ap archives, that's why it's displaying Missing Properties for ap packed content. Which is fine for the purpose of checking the location of added Workshop or your own scenarios, because they are not stored in archives. (.ap archive = zip file with zero compression, like a UNIX tarball. Introduced for faster file access, less file cluttering and fragmentation and easier checksumming as a DLC consist of many thousands of files sometimes.)

    Each scenario and route is stored in a folder which has a GUID as a name. NameMyRoute allows you to directly open the scenarios' folders.

    For example, 00000001-0000-0000-0000-000000000000 is the GUID of "Great Western Mainline". Expanding this shows all the scenario GUID folders. That's how they are stored on your harddisk, full path is "<SteamLocation>\steamapps\common\RailWorks\Content\Routes\".

    So this is a quick way to locate scenarios. (Of course there's others, but this has the advantage of not reading .ap files for the purpose of locating corrupt scenarios.)

    I would advise after such a cleanup, to delete RailWorks\Content\SDBCache.bin to let TS rebuild the scenario cache used for the Drive menu. Don't worry, your progress will not be lost as it is stored in the Steam\userdata folder.
     
    Last edited by a moderator: Jan 24, 2023
  30. KodiakJac

    KodiakJac Active Member

    Joined:
    Jul 30, 2022
    Messages:
    142
    Likes Received:
    78
    Ok, got it!

    Do you prefer Rib-Eye, New York, Fillet Mignon, T-Bone, or Porterhouse? What's your cut? :cool:
     
  31. torfmeister

    torfmeister Guest

    Rib-Eye, medium please. :D
     
    • Like Like x 1

Share This Page