Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Charts Crashing: Write lock may not be acquired with read lock held.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Charts Crashing: Write lock may not be acquired with read lock held.

    I upgraded to from 8.0.26.1 to 8.0.27.1 a couple of days ago.

    My charts are freezing regularly, and when I close Ninjatrader I get the following error:



    ​I'm struggling to reproduce the issue and I've not been able to narrow it down to any specific indicator.

    Is there a known issue at the moment?

    #2
    Hello kevinenergy​,
    Thank you for your post.

    Typically this error is 3rd Party related when they run out of available resources to support the platform + 3rd party indicators. First let's eliminate variables like connections issues and custom add-ons.

    Please check for software such as (corporate) firewalls, spyware and anti-virus software that could be blocking NinjaTrader. In some cases the modem/router has built-in software that prevents the connection to be established.

    To resolve this, I recommend the following steps (test for the issue after each step):
    • Restart your modem and (if applicable) router
    • Restart your PC
    • Also, ensure that your computer is not turning off your Network Adapter to conserve power:
      • Restart NinjaTrader
      • Right-click on your Start button
      • Select 'Device Manager'
      • Expand 'Network Adapters'
      • Right-click on your Network Adapter and select Properties > Power Management
      • Uncheck 'Allow the computer to turn off this device to save power' option
      • Click 'OK' to save the changes
      • Do this for all Network Adapters
    • Clear your DNS
    • If you are not already and the option is available to you, connect to the internet using an ethernet cable. Wireless connections are significantly more unreliable.
    • Ensure exceptions have been added into any firewall/antivirus/backup programs for the Documents > "NinjaTrader 8" folder.
    • If the above steps do not help, contact your ISP and let them know you are experiencing a highly unstable connection. An issue of connectivity may exist on their end.

    Next, so we can further diagnose your system, please start NinjaTrader in Safe Mode.Safe Mode will prevent NinjaTrader from:
    • Loading workspaces.
    • Connecting on start-up.
    • Loading custom assemblies.
    • Getting instrument updates from the server.

    To enable safe mode, please use the following steps:
    • Exit NinjaTrader.
    • Hold the Ctrl (Control) key and double click the NinjaTrader icon.
    • Keep the Ctrl (Control) key held down until you see the Control Center.
    • You can verify you are in safe mode by going to Help -> About.

    Once you have opened the platform in safe mode:
    • Reconnect to your Data Provider
    • Go to Control Center > Workspaces > New > Give this Workspace a unique name like "Test" and click OK
    • Open a new chart with no custom bar types/indicators/templates and test for issues.

    If there are no issues with this new workspace, go to Control Center > Workspaces > hover over the workspace you just made and click Save.
    • Once saved, hover over all other open Workspaces and click Close until only the Test Workspace you just made is open

    Now, click X out of the platform and select "No" to "Do you want to save changes"

    Now reopen the platform like normal. It should open to the workspace you just created.
    • Is everything still working as expected?
    • Now try opening the other workspace that was bringing in the unwanted behavior
    • If this reintroduces issues, this lets us know that the 3rd party add-ons brought in the unwanted behavior.

    I would suggest rebuilding your workspace, adding 1 indicator at a time. Please keep track of what indicators you add back in so that you may narrow down what indicator is causing the issue if the issue returns.

    I look forward to resolving this matter.​
    Adrian B.NinjaTrader Customer Service

    Comment


      #3
      I had this same problem and found the root cause to be having Kinetick and Apex connections on at the same time (NQ). Once I turned off Kinetick and ran solely with Apex and have not had the deadlock since.

      Comment


        #4
        I am having the same issue, but ONLY with Kinetick connected

        Comment


          #5
          Hello DTSSTS​,
          Thank you for posting.

          I'm happy to check into this with you if you would please email us at PlatformSupport [AT] NinjaTrader [DOT] com. In your message please include a link to this forum thread and a message 'ATTN ADRIAN'.

          Additionally, please follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.
          • Open your NinjaTrader folder under My Documents.
          • Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
          • Send the 2 compressed folders as attachments to this email.
          • Once complete, you can delete these compressed folders.

          Thank you in advance; I look forward to resolving this item.​
          Adrian B.NinjaTrader Customer Service

          Comment


            #6
            already in progress but thanks

            Comment


              #7
              I was never able to get to the bottom of the issue despite very exhaustive testing and a process of elimination on custom code.

              I downgraded to 8.0.26.1 and I am still using that release today.

              I don’t use Kinetic.

              Comment


                #8
                Hello kevinenergy​,
                Thank you for your post.

                I'm happy to check into this with you as well if you would please email us at PlatformSupport [AT] NinjaTrader [DOT] com. In your message please include a link to this forum thread and a message 'ATTN ADRIAN'.

                Additionally, please follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.
                • Open your NinjaTrader folder under My Documents.
                • Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
                • Send the 2 compressed folders as attachments to this email.
                • Once complete, you can delete these compressed folders.


                Thank you in advance; I look forward to resolving this item.​
                Adrian B.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks Adrian, but presently I have no issues on 8.0.26.1 so I have nothing to share with you.
                  I understand that I am required to upgrade to 8.0.28.0 on 23th June. So will get back to you if the problem materialises again on that release.


                  Originally posted by NinjaTrader_Adrian View Post
                  Hello kevinenergy​,
                  Thank you for your post.

                  I'm happy to check into this with you as well if you would please email us at PlatformSupport [AT] NinjaTrader [DOT] com. In your message please include a link to this forum thread and a message 'ATTN ADRIAN'.

                  Thank you in advance; I look forward to resolving this item.​

                  Comment


                    #10
                    Here is another user posting about the same issue

                    https://forum.ninjatrader.com/forum/...-1#post1253246

                    i realise this is not ideal from a support point of view as these queries now relate to an older version of the app. But I notice the user in this other post states that he still gets the same problem in 8.1.1.16. And like me this other user sees no issues on 8.0.26.1 and he too is stuck on that release.

                    The problem clearly relates to something that was introduced from 8.0.27.0 onwards.

                    I just don’t have the time right now to upgrade and investigate this further for now I need to stick with what works. And that is 8.0.26.1.

                    Does Ninjatrader gather any usage metrics about what versions of the app are still in active use? I would not be surprised if there is an unusually high number of users still running 8.0.26.1 due to this problem.
                    Last edited by kevinenergy; 05-27-2023, 05:04 AM.

                    Comment


                      #11
                      I also have the same issue as kevinenergy (and the other user he linked to in comment #10 which is how I found this thread). I originally encountered this problem after upgrading to 8.0.27.0 (from 8.0.26.1) several months ago but immediately rolled back and have had no issues until today after upgrading over this past weekend to 8.1.1.6. Today I sent an email to support with Log & Trace files. The response I received was sort of an automated response of basic performance tips, Window updates, and clearing db files (cache, day, minute, tick) . By the time I finished these steps, the market had closed so I don't really know if they have worked. (Pretty doubtful).
                      Last edited by Taggart; 05-30-2023, 07:05 PM.

                      Comment


                        #12
                        You guys probably have a bunch of 3rd party indicators running across multiple charts, and it sounds like the way those indicators process data is causing a conflict in SQLite.

                        Starting in version 8.0.27, there is change with SQLite Database technology. From the release notes, "We have updated our core internal database technology from the deprecated Microsoft SQL CE to SQLite. Supported / documented NinjaScript code will not be impacted by this change; however if you have specifically developed your Add-On to call or interact with the Microsoft SQL CE database you should review and update code for compatibility.". https://ninjatrader.com/support/help...8/8_0_27_1.htm

                        Sending log & trace files to NinjaTrader support isn't going to help because the log & trace files don't provide any clues currently.

                        Ideally NinjaTrader can enhance their log reporting and include in the log & trace files clues as to what is causing the read lock.

                        Purposefully replicating the issue is going to be hard, so would be great if NinjaTrader can just search in their error codes for the error about read locks, and if possible, include more details. Otherwise, everyone getting the error messages in their workspaces now are going to be forced to cut down on their charts and indicators or switch to a different broker starting on June 23rd.

                        The whole thing between NinjaTrader and 3rd party indicators is a delicate balance because they each like to blame the other, but would be nothing without each other. I think it's fair that NinjaTrader pushes the issue back on the vendors, but the least they can do is provide better reporting so the users know which vendors to contact.

                        OR, before the June 23rd cut off, NinjaTrader can release a 3rd version, 8.0.26.2, which would be the deprecated Microsoft SQL CE but with the upgraded CQG Server Certificate. This would likely be the best option to keep all users happy for a little longer.
                        Last edited by backtester831; 05-31-2023, 07:50 AM.

                        Comment


                          #13
                          Thanks for your input. Although the error message sounds like a database lock issue it is actually not related to databases. It is a System.Threading.LockRecursionException which is related to multi-threading locks. Historically, when this error message appears in Ninjatrader its usually related to a chart rendering problem (resources not being disposed etc), but could be any kind of multi-threading lock scenario not database table/row locks.

                          You guys probably have a bunch of 3rd party indicators running across multiple charts
                          Nobody can trace this back to a single indicator. Either collectively or on a single machine. I personally have systematically removed and retested all the indicators and addons I'm using, using a process of elimination to get to the root-cause. I could not trace the problem to any one item. I'm also using my own code; no third party stuff. I'm also using different things to the other people reporting the problem. All I know is, it doesn't happen when there's nothing on the chart. But I also can't trace it to a specific thing.

                          Everything works on 8.0.26.1, the issues happen from 27.0 onwards - this is a Ninjatrader problem not a third-party problem.



                          Originally posted by backtester831 View Post
                          You guys probably have a bunch of 3rd party indicators running across multiple charts, and it sounds like the way those indicators process data is causing a conflict in SQLite.

                          Starting in version 8.0.27, there is change with SQLite Database technology. From the release notes, "We have updated our core internal database technology from the deprecated Microsoft SQL CE to SQLite. Supported / documented NinjaScript code will not be impacted by this change; however if you have specifically developed your Add-On to call or interact with the Microsoft SQL CE database you should review and update code for compatibility.". https://ninjatrader.com/support/help...8/8_0_27_1.htm

                          Sending log & trace files to NinjaTrader support isn't going to help because the log & trace files don't provide any clues currently.

                          Ideally NinjaTrader can enhance their log reporting and include in the log & trace files clues as to what is causing the read lock.

                          Purposefully replicating the issue is going to be hard, so would be great if NinjaTrader can just search in their error codes for the error about read locks, and if possible, include more details. Otherwise, everyone getting the error messages in their workspaces now are going to be forced to cut down on their charts and indicators or switch to a different broker starting on June 23rd.

                          The whole thing between NinjaTrader and 3rd party indicators is a delicate balance because they each like to blame the other, but would be nothing without each other. I think it's fair that NinjaTrader pushes the issue back on the vendors, but the least they can do is provide better reporting so the users know which vendors to contact.

                          OR, before the June 23rd cut off, NinjaTrader can release a 3rd version, 8.0.26.2, which would be the deprecated Microsoft SQL CE but with the upgraded CQG Server Certificate. This would likely be the best option to keep all users happy for a little longer.
                          Last edited by kevinenergy; 05-31-2023, 01:23 PM.

                          Comment


                            #14
                            backtester831 kevinenergy You might take a look at this thread https://forum.ninjatrader.com/forum/...read-lock-held and the response I gave regarding the handling of brushes. Because OnRender and OnBarUpdate run in separate threads at the same time, you have to be very careful with how you handle resources that OnRender may use. That's just an example of a way to fail - there are many others. It's very, very easy to do this wrong and there's really only a narrow path to do it right. It's a great insight and a great thought that because SQLite was used in 27 that it could be related to that. It could be. But there are other possibilities that directly lead to this error that aren't tied to the database. Why that code works in .26 and not in .27 is an open question. None of us know.

                            Also, I just want to point out, that error message about write lock and read lock has been happening for YEARS not just since .27 - if you paste the message into the forum or into Google with site:forum.ninjatrader.com it goes on for some time. In fact, if you leave off the site limitation and just paste the message into Google, the number one result is about NinjaTrader 8.0.5.0 in the year 2017, which goes to show this has been around ever since 8.0 was released. And it's so common in NinjaTrader that even though that's not a Ninja-specific message, the NinjaTrader complaints about it are number one on Google for that framework message (the actual exception is in System.Threading). The reason this sort of thing never happened with 7.0 is it wasn't multithreaded in the same way, so indicator writers didn't have to do things "right" back then.
                            Last edited by QuantKey_Bruce; 05-31-2023, 04:16 PM.
                            Bruce DeVault
                            QuantKey Trading Vendor Services
                            NinjaTrader Ecosystem Vendor - QuantKey

                            Comment


                              #15
                              So it is being caused by a 3rd party indicator?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by f.saeidi, Today, 12:14 PM
                              2 responses
                              5 views
                              0 likes
                              Last Post f.saeidi  
                              Started by TradeForge, 04-19-2024, 02:09 AM
                              2 responses
                              28 views
                              0 likes
                              Last Post TradeForge  
                              Started by aprilfool, 12-03-2022, 03:01 PM
                              3 responses
                              327 views
                              0 likes
                              Last Post NinjaTrader_Adrian  
                              Started by giulyko00, Today, 12:03 PM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by AnnBarnes, Today, 12:17 PM
                              1 response
                              2 views
                              0 likes
                              Last Post NinjaTrader_Zachary  
                              Working...
                              X