Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fusion++ did not work(log folder lack of permission) #14

Closed
chucklu opened this issue Apr 29, 2020 · 33 comments
Closed

Fusion++ did not work(log folder lack of permission) #14

chucklu opened this issue Apr 29, 2020 · 33 comments

Comments

@chucklu
Copy link

chucklu commented Apr 29, 2020

I have tried with fusion++ 1.1 and 1.2, both of them did not work. I click record and open an IIS site, and the site reproduce an exception "Could not load file or assembly". Then I click stop, but the software told me "Relax no data yet".
How can I troubleshooting this, I did not find any log under Fusion++.

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

It's really weird, I tried the Fuslogvw.exe to do the log feature. It still did not work.
Not sure what's wrong with my computer system, we just reimage our system.
Microsoft Windows [Version 10.0.18363.657] (1909)
(c) 2019 Microsoft Corporation. All rights reserved.

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\FUSLOGVW.exe works fine.
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\FUSLOGVW.exe did not work.

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

C:\Users\clu\Downloads\Fusion++.1.2>corflags "Fusion++.exe"
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0
Copyright (c) Microsoft Corporation. All rights reserved.

corflags : error CF008 : The specified file does not have a valid managed header

C:\Users\clu\Downloads\Fusion++.1.1>corflags "Fusion++.exe"
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.8.3928.0
Copyright (c) Microsoft Corporation. All rights reserved.

Version : v4.0.30319
CLR Header: 2.5
PE : PE32
CorFlags : 0x20003
ILONLY : 1
32BITREQ : 0
32BITPREF : 1
Signed : 0

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

https://stackoverflow.com/questions/18608785/how-to-interpret-the-corflags-flags

Microsoft .NET 4.5 introduced a new option, Any CPU 32-bit Preferred. In the new version of CorFlags.exe, the 32BIT flag no longer exists, instead, two new flags were added, 32BITREQ and 32BITPREF.

Somewhere based on the below explanation, we can interpret new CorFlags as follows.

CPU Architecture PE 32BITREQ 32BITPREF


x86 (32-bit) PE32 1 0
x64 (64-bit) PE32+ 0 0
Any CPU PE32 0 0
Any CPU 32-Bit Preferred PE32 0 1

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

The fusion++1.1 was Any CPU 32-Bit version, I tried to run it as admin. And can not get any log.
What's the type of fusion++1.2? 32or 64 bit application?

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

Interesting, I got some binding failures for fusion++ from Fuslogvw.
image

Fusion++.exe.zip

@awaescher
Copy link
Owner

awaescher commented Apr 29, 2020

That's a strange behavior, indeed. As I read this, I don't think this is related to the bitness of the application.

What Fusion++ does to activate the log - and that's similar to the old FUSLOGVW - is setting up some registry keys. See https://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net, for example.

On your side, I'd check the registry and what differs from a not-working FUSLOGVW and the working one. I'd be very interested in these differences, btw. After that, it would be very interesting to see what Fusion++ does on your system.

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

I have figured out why I mistakenly think the 64 bit vesion Fuslogvw did not work.
Because the web forms site will load the dependency only once when the site first start.

Now I test the Fuslogvw with 32 bit and 64 bit version, both of them works. (I need to do the iisreset to make sure the site will reload again).
Now the problem would be, why the Fusion ++ did not work, even if I have done the iisreset to make sure the site will be reloaded.

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

By the way, I already configured the registry key as mentioned above.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
Add:
DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
DWORD EnableLog set value to 1
String LogPath set value to folder for logs (e.g. C:\FusionLog)

When I open the registry editor, I lost the EnableLog setting and ForceLog setting.
image

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

I find the difference about the registry key.
Before the fusion++ run, the registry keys are as following:
image

After I run the fusion++, some keys are lost, eg: EnableLog
image

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

The register keys only changed after I click the record button of fusion++, I have tried to add the missing registry key back after click record button.

Set-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogFailures      -Value 1               -Type DWord
Set-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name EnableLog        -Value 1               -Type DWord

However, even if I did the iisreset, and reload the site with "Could not load file or assembly" exception. Then stop the fusion++, still got nothing for log.

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

Another clue, the fusion++ can record log for software EveryThing.exe, but can not record log for IIS site(an web application under site).
folder 2020.04.29.07.47.14.7452 contains logs, and folder 2020.04.29.07.52.45.7891 contains nothing (It supposed to have logs for IIS web application).
image

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

Test with another site, and still did not work. The only difference seems like the log folder.

@awaescher
Copy link
Owner

This has nothing to do with the folders. These are being created by Fusion++ for each recording session. If nothing is logged during a session, they stay empty.
I suppose that there's an issue with your IIS or that everything you fire up is .NET Core which cannot be logged with Fusion++ (also not via Registry keys or FUSLOGVW.exe).

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

I am running a web forms site, and it's based .net framework.
And the log can be recorded by FUSLOGVW.exe, when I switch to Fusion++, then it will not record the log.

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

Did you know how to build a website through IIS?
Maybe I can provide you a sample site with source code, then you can reproduce it on your local environment.

@awaescher
Copy link
Owner

I won't dig into this atm, thanks. This seems not related to Fusion++ but also to the FUSLOGVW (at least x86).

@chucklu
Copy link
Author

chucklu commented Apr 29, 2020

FUSLOGVW x86 also works fine.

@lethek
Copy link

lethek commented Apr 30, 2020

I'm having the exact same issue:

Both x86 and x64 FUSLOGVW tools are working fine (same version as @chucklu: v10.0A), though only after I recycle the relevant app-pool in IIS each time.

On the other hand, I've so far been unable to get Fusion++ to record anything for my IIS web-app at all (targets ASP.NET 4.8, AnyCPU). Unlike FUSLOGVW, recycling the application pool in IIS has no effect.

Confirmed that in my case, the registry keys set by FUSLOGVW and Fusion++ are identical except for the LogPath one.

Fortunately at least for my own issue I was trying to solve, I was able to record the logs with FUSLOGVW and then import those logs into Fusion++.

@awaescher
Copy link
Owner

Fortunately at least for my own issue I was trying to solve, I was able to record the logs with FUSLOGVW and then import those logs into Fusion++.

Well done.

So this is not related to the @chucklu's machine you say? Okay, I might give it a try. Would any of you @chucklu or @lethek upload a zipped solution to reproduce the issue?

@awaescher awaescher reopened this Apr 30, 2020
@chucklu
Copy link
Author

chucklu commented Apr 30, 2020

@awaescher I am not able to build Fusion++ by source code. Could you please build a test version, and hard code the log path as "C:\FusionLogs"? Then I can test Fusion++ to check if the problem was caused by the log path.

@lethek
Copy link

lethek commented Apr 30, 2020

I'll try to create a minimal solution that reproduces the issue on my PC at least.

Note: so far I haven't tried Fusion++ with any other web-apps or other .NET apps - so not yet sure if there may be something weird about this particular one (which has been continuously maintained and upgraded for about 10 years now), or the way I'm hosting it on my dev machine.

@awaescher
Copy link
Owner

You can start Fusion++ and start logging. Then, in the registry change the log path as you want it to be. That'll work. As soon as you close fusion++, it will reset the values as they were before starting Fusion++.

Building requires you to have a DevExpress subscription.

@chucklu
Copy link
Author

chucklu commented Apr 30, 2020

@awaescher I tried to change the log path to "C:\FusionLogs" after the Fusion++ start record. The log was recorded successfully.
I checked the security tab of these two folders, the folder created by Fusion++ could only be accessed by System user group, current logon user and Administrators user group.
The problem should be the permission access.

@chucklu
Copy link
Author

chucklu commented Apr 30, 2020

@chucklu
Copy link
Author

chucklu commented Apr 30, 2020

@awaescher I just granted the MachineName\Users user group permission to the log folder Fusion++ created. Then it works perfectly.

@chucklu chucklu changed the title Fusion++ did not work Fusion++ did not work(log folder lack of permission of IIS application pool identity) Apr 30, 2020
@lethek
Copy link

lethek commented Apr 30, 2020

Nice work! That appears to be the cause of the problem for me too.

However, now after manually adding permission to the parent dir, I've got an Exception when it attempted to parse the logs - I'll investigate that a bit further and post a new Issue if need be.

@chucklu chucklu changed the title Fusion++ did not work(log folder lack of permission of IIS application pool identity) Fusion++ did not work(log folder lack of permission) Apr 30, 2020
@awaescher
Copy link
Owner

Oh wow, good spot. So this has nothing to do with x86/x64?
Thinking of this ...

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\FUSLOGVW.exe works fine.
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\FUSLOGVW.exe did not work.

@chucklu
Copy link
Author

chucklu commented Apr 30, 2020

I have figured out why I mistakenly think the 64 bit vesion Fuslogvw did not work.
Because the web forms site will load the dependency only once when the site first start.

Now I test the Fuslogvw with 32 bit and 64 bit version, both of them works. (I need to do the iisreset to make sure the site will reload again).
Now the problem would be, why the Fusion ++ did not work, even if I have done the iisreset to make sure the site will be reloaded.

@awaescher Maybe you did not read this comment yesterday.

@awaescher
Copy link
Owner

Just wanted to have this confirmed.

@chucklu
Copy link
Author

chucklu commented Apr 30, 2020

The issue has nothing to do with the 32 bit or 64 bit. It's just a security problem, the log folder you created could not be accessed by Fuslogvw.

@awaescher
Copy link
Owner

Version 1.3 was just released.
I would be happy to hear if this issue is gone now.

@chucklu
Copy link
Author

chucklu commented Jul 17, 2020

@awaescher It works with the new version 1.3 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants