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

Access denied #6

Open
JeanCollas opened this issue Jul 14, 2018 · 6 comments
Open

Access denied #6

JeanCollas opened this issue Jul 14, 2018 · 6 comments

Comments

@JeanCollas
Copy link

Woud you see any reason why it would throw an "access denied"?

I have two websites with the exact same code, on the same server, one is working well, the second is not, and throws:

Access is denied
----------------

at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at jsreport.Local.Internal.BinaryProcess.InnerExecute(String cmd, Boolean waitForExit)
at jsreport.Local.Internal.BinaryProcess.ExecuteExe(String cmd, Boolean waitForExit)
at jsreport.Local.Internal.LocalUtilityReportingService.RenderAsync(String requestString, CancellationToken ct)

@pofider
Copy link
Contributor

pofider commented Jul 17, 2018

Here is the thread discussing this
https://forum.jsreport.net/topic/428/asp-net-an-error-has-occurred-when-trying-to-initialize-jsreport/18

I'm far less qualified than Jan to comment, but I'll give a few thoughts! If you error message is "Access is denied", then I would first try running the project as administrator. If that doesn't work, go to every place that jsreports will be accessing (temp folder, folder where you store templates, etc) and make sure the security allows access. If you're using IIS, then you'll have to grant full control to "IUSR" and "IIS_IUSRS"

or it can be also blocked by windows defender...

@radamsikes
Copy link

I know this thread is old, and I don't particularly like to grave-dig, however, I am encountering the same issue, and it has nothing to do with actual authorization.

I have two copies of an ASP.NET Core application deployed to two different environments on the same server, one is development, one is test. I can successfully "run" a report from one or the other; the first process that starts the jsreport engine can render reports, while the other application will get the same error reported by OP JeanCollas.

If I open IIS Manager and stop the site that successfully launches reports, the site that previously threw the above-mentioned error would work. Upon further troubleshooting, I turned on "Load User Profile" in the application pool for the application, and then it throws a different error than the one listed above. The new error more accurately describes the issue; both applications are starting a process at a certain port (5488), and only the first to do so succeeds.

Here is the configuration in the ASP.NET Startup.cs file; please let me know if there is a modification I need to make to it to allow both dev and test instances to co-exist on the same server:

services.AddJsReport(new LocalReporting()
.UseBinary(JsReportBinary.GetBinary())
.KillRunningJsReportProcesses()
.RunInDirectory(Path.Combine(Directory.GetCurrentDirectory(), "jsreport"))
.AsUtility()
.Create());

@pofider
Copy link
Contributor

pofider commented Feb 7, 2020

Please use a different port on the second env

services.AddJsReport(new LocalReporting()
.UseBinary(JsReportBinary.GetBinary())
.KillRunningJsReportProcesses()
.RunInDirectory(Path.Combine(Directory.GetCurrentDirectory(), "jsreport"))
.Configure(cfg => {
  cfg.HttpPort = 5489;
  return cfg
})
.AsUtility()
.Create());

@radamsikes
Copy link

radamsikes commented Feb 7, 2020

Firstly, Jan, thank you for your dedication to this project. It has been consistent over a LONG period of time. This is truly impressive to me; you have my unabashed respect!

I have made the configuration change you indicated above, and am waiting my turn "in line" to be able to deploy to a shared resource to test.

I will delve further into the documentation to see if I can discern how to make the above change in the web.config or appsettings.json so that I can create appropriate publish profiles to achieve the desired result without having to change code to deploy to various environments (dev, test, prod).

Thank you again!

@pofider
Copy link
Contributor

pofider commented Feb 7, 2020

Thank you. FYI the information is already in the docs git, it just isn't yet live, but it will be soon. Let me know if you have further issues.

@radamsikes
Copy link

Thank you for the link Jan, my issue was resolved by the following:

I implemented the Configure portion in Startup.cs, as you indicated and deployed to the shared environment. I updated both site application pools with "Load User Profile" set to "true". This resolved both the authorization and collision issues.

I then followed your documentation link to learn a bit about using a config file. I removed the configure portion from Startup.cs, and instead set httpPort in a jsreport.config.json file. I deployed the resulting build to the shared environment and confirmed both parallel application were working as intended.

Thank you again Jan!

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