Debugging startup problems

Posts   
 
    
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 05-Jul-2019 08:23:47   

Hello,

we are having problems with the profiler.

All of the required DLL's are loaded and the application is started successfully, however, there's no output in the profiler.

One change that we've made is installed latest dotConnect for PostgreSQL in the last week and updated windows to the latest release of Windows 10.

After that the profiler stopped working, before it was working fine.

Are there any logs that we can inspect or do you have any tips for us on how to troubleshoot this?

We are using LLBLGen 5.3 with PostgreSQL for our development and I've testing with both ORMProfiler 1.5 and 2.0, and none work currently.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 05-Jul-2019 09:32:22   

LLBLGen Pro uses Npgsql for postgresql, so all queries will be executed using that ADO.NET provider. They still should be showing up in the profiler though. dotConnect is from devart, and the DQE doesn't support that one (although if you pass it on .net standard through the RuntimeConfiguration it could work, we just haven't tested that)

You're not specifying whether you're using .net core or .net framework. If the former, you have to wrap the factory using https://www.llblgen.com/Documentation/ORMProfiler/2.0/Getting%20Started/EnablingForProfiling.htm#net-core-2.0 If you're using .net framework, the factories are wrapped by the profiler at app startup, so make sure the interceptor is called before anything else.

Frans Bouma | Lead developer LLBLGen Pro
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 05-Jul-2019 16:09:22   

We are using npgsql also (3.2.6 version to be exact).

I've just reinstalled and still nothing.

The application is a console application written in .Net 4.7.1.

The gudies from the link you posted have been implemented.

In the curren scenarion, we are using the DLL's from: C:\Program Files (x86)\Solutions Design\ORM Profiler v1.5

And those are SD.Tools.Algorithmia SD.Tools.BCLExtensions SD.Tools.OrmProfiler.Interceptor.EFv6.NET40 SD.Tools.OrmProfiler.Shared

We've also tested with SD.Tools.OrmProfilder.Interceptor.NET45 but still no response.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 05-Jul-2019 19:37:30   

I've just reinstalled and still nothing.

What did you install, the ORM Profiler or the npgsql?

The gudies from the link you posted have been implemented.

That's only needed for .NET core.

Please open the ORMProfiler.exe.config file and add the npgsql DBProviderFactory, there is a commented sample, so you will know what you should do.

Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 05-Jul-2019 20:25:37   

Walaa wrote:

I've just reinstalled and still nothing.

What did you install, the ORM Profiler or the npgsql?

npgsql

The gudies from the link you posted have been implemented.

That's only needed for .NET core.

Sorry, I didn't express my self correctly. We've done the setup for .Net full according to the site. Meaning, we only added the call to the Initialize method.

Please open the ORMProfiler.exe.config file and add the npgsql DBProviderFactory, there is a commented sample, so you will know what you should do.

Tried this, but still not luck.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 06-Jul-2019 10:34:40   

In your app's setup function/method, where you call the Interceptor's initialize method, AFTER the call to the initialize method, try:

var factory = DbProviderFactories.GetFactory("npgsql"); string fullTypeName = factory.GetType().FullName;

'factory' is now a wrapped factory. so fullTypeName should be the profiler factory, not Npgsql's.

If the application itself works fine, but nothing arrives in the client, it might be something's blocking the named pipe from the interceptor to the profiler client. It only works if both run on the same machine. We use windows 10 (1809) and that works fine, also with npgsql, so without a repro case we can't do much else than guess..

Frans Bouma | Lead developer LLBLGen Pro
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 08-Jul-2019 08:14:20   

Otis wrote:

In your app's setup function/method, where you call the Interceptor's initialize method, AFTER the call to the initialize method, try:

var factory = DbProviderFactories.GetFactory("npgsql"); string fullTypeName = factory.GetType().FullName;

'factory' is now a wrapped factory. so fullTypeName should be the profiler factory, not Npgsql's.

If the application itself works fine, but nothing arrives in the client, it might be something's blocking the named pipe from the interceptor to the profiler client. It only works if both run on the same machine. We use windows 10 (1809) and that works fine, also with npgsql, so without a repro case we can't do much else than guess..

I've tested it, and it is, here's the output:

SD.Tools.OrmProfiler.Interceptor.ProfilerDbProviderFactory`1[[Npgsql.NpgsqlFactory, Npgsql, Version=3.2.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7]]

I did some research for the named pipe that you mentioned.

When I do an export in Powershell using: [System.IO.Directory]::GetFiles("\.\pipe\")

I get the \.\pipe\SD.Tools.OrmProfiler enrtry

However, when I use Process Explorer (https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer) I don't see that entry.

My guess is that something is preventing my application from pushing data into that pipe, any suggestions on how I can debug that? simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Jul-2019 10:10:09   

If the interceptor can't connect to the pipe, it stops silently, as in production code you don't want exceptions to flood some log just because a client isn't available.

If the client is up and on the same machine, in process explorer you should see: File \Device\NamedPipe\SD.Tools.OrmProfiler

If you're using the latest ormprofiler client (2.0.1) it's recommended that you use the v2.0 interceptor as well.

The factory is properly wrapped so messages should be send. What I'm a bit puzzled about is your remark: "installed latest dotConnect for PostgreSQL". The factory that's wrapped is v3.2.6, which is definitely not the latest npgsql (if that's what you meant with dotconnect for postgresql).

If the only other thing that has changed is windows 10 latest version it might be something with the firewall in windows, but then again, I have a bit of doubt why that would be a problem with a named pipe.

Additionally, the user the app runs under, is that the same as the ormprofiler client? Perhaps it doesn't have the right ACL to access the named pipe, although we never had problems with that.

I've attached a debug build of the interceptor for .net full (profiler 2.0) which will rethrow the exception if it runs into one while connecting. This might give more insight in why this is. If you're using R# or Rider, you could step into the code of the InterceptorCore.Initialize() method and see what's going on when it tries to connect in NamedPipeChannel.ConnectToPipeThreadBody

Attachments
Filename File size Added on Approval
SD.Tools.OrmProfiler.Interceptor.NetFull.dll 43,008 08-Jul-2019 10:10.30 Approved
Frans Bouma | Lead developer LLBLGen Pro
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 08-Jul-2019 14:02:47   

I've checked your .dll and it's not throwing any exceptions, everything runs fine.

I've swithed the other DLL's for the final version and got rid of everything from the 1.5 version of ORM profiler.

dotConnect is used in our other projects, it this particular project we are using npgSQL. My reference to dotConnect what that that and the Windows update were the only changes made in the last week.

I've tried disabling the Firewall and my anti virus software, but still nothing.

Could you attach the pdb file of the dll you attacheds so I can debug it from VS? If it's not a problem?

I've restarted everything and now I saw the named pipe in the Process Explorer.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Jul-2019 14:55:52   

Sure, it's attached.

Weird problem though, I have no idea why this suddenly fails...

Attachments
Filename File size Added on Approval
SD.Tools.OrmProfiler.Interceptor.NetFull.pdb 118,272 08-Jul-2019 14:56.11 Approved
Frans Bouma | Lead developer LLBLGen Pro
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 09-Jul-2019 16:08:41   

Where can we download the latest version of the ORM Profiler? On the My Account page we can se only LLBLGen download links.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Jul-2019 21:06:45   

Under My account -> Downloads, it's the top link simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 10-Jul-2019 07:54:53   

Otis wrote:

Under My account -> Downloads, it's the top link simple_smile

Maybe I'm partially blind, but I don't see it smile

I've attached a screenshot of the dropdown

Attachments
Filename File size Added on Approval
Screenshot_2.png 26,465 10-Jul-2019 07:55.01 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 10-Jul-2019 09:11:04   

Oh my bad, you have to have a valid subscription to download it. (as it's free for people with an active subscription). I was under the assumption you were using v2.0.1 of the orm profiler. Sorry for this confusion. flushed

Anyway, v1.5 should work with .net full (if you use the v1.5 interceptor). The build I gave is for 2.0, not 1.5. In your start post you said you tested with orm profiler 2.0 so I assumed you had the 2.0 client.

Frans Bouma | Lead developer LLBLGen Pro
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 10-Jul-2019 09:22:34   

Otis wrote:

Oh my bad, you have to have a valid subscription to download it. (as it's free for people with an active subscription). I was under the assumption you were using v2.0.1 of the orm profiler. Sorry for this confusion. flushed

Anyway, v1.5 should work with .net full (if you use the v1.5 interceptor). The build I gave is for 2.0, not 1.5. In your start post you said you tested with orm profiler 2.0 so I assumed you had the 2.0 client.

I had 2.0 Beta installed so I wanted to upgrade it to 2.0, but if it's not available, that's fine.

Could you please send me debug dll and pdb file for 1.5? If it's not a problem?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 10-Jul-2019 11:47:00   

I've attached the normal and .net45 interceptor for 1.5 (debug build) with pdbs. I've also augmented the code so it'll throw the exception if it catches any during connect.

Attachments
Filename File size Added on Approval
Interceptor15Debug.zip 183,835 10-Jul-2019 11:47.17 Approved
Frans Bouma | Lead developer LLBLGen Pro
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 10-Jul-2019 12:42:40   

Thanks for the files, I've tested on the current project and it's still not working and there are not errors disappointed

However, I've tested on another (older) project, and everything is working, I can see output in the ORM Profiler disappointed

I'll try and compare what are the differences between the two of them and let you know if I find anything.

Thanks for all the help.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 10-Jul-2019 14:27:27   

Hmm. Very strange! Hopefully you'll find something. These things can get hairy to debug... if we have to provide more info about code etc., let us know.

Frans Bouma | Lead developer LLBLGen Pro