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

Failed to access .local-chromium #295

Closed
LucasNmn opened this issue Jun 8, 2022 · 8 comments
Closed

Failed to access .local-chromium #295

LucasNmn opened this issue Jun 8, 2022 · 8 comments

Comments

@LucasNmn
Copy link

LucasNmn commented Jun 8, 2022

Hi,

I'm trying to export an svg string in an ASP.NET WebApp with Plotly.Net vers 2.0 . It works fine on my local computer but when i try rolling it out on an IIS server i get "no permission on c:/path-to-file/.local-chromium" ). The issue might be a wrong installation of the chromium browser but I'm not quite sure. Maybe I have to set the executablepath for PuppeteerSharp but I don't know where to do this.

Do you have any idea how to fix this?

@kMutagene
Copy link
Collaborator

Since #264 got merged, i think you should be able to set the executable path via PuppeteerSharpRendererOptions.localBrowserExecutablePath :

module PuppeteerSharpRendererOptions =
let mutable launchOptions = LaunchOptions()
launchOptions.Timeout <- 60000
let mutable localBrowserExecutablePath =
None

Just set it to a path via mutable assignment (PuppeteerSharpRendererOptions.localBrowserExecutablePath <- Some "path/here")

@kMutagene
Copy link
Collaborator

On another note, it might be that your application simply does not have the permissions to access the content of .local-chromium. It has been some time since i used IIS, but there is a user (IIS_USRS or IUSR or something like that), which symbolizes the access rights of your IIS application. If your .local-chromium folder is persistent, adding full access for those users might do the trick.

@LucasNmn
Copy link
Author

Thanks for your advice. I've updated from Version 2.0 prev 6 to Version 2.0. I'm now getting some strange behaviour. When I'm exporting an image to an svg string with chart.ToSVGString() the functions hangs up in an endless loop. When I'm generating an image with :

chart = GenericChart .ofTraceObject(true, trace) .WithLayout(layout) .WithConfig(config) .WithShapes(shapeList) .Show();,

It's exporting an image. I added the executable like:

Plotly.NET.ImageExport.PuppeteerSharpRendererOptions.localBrowserExecutablePath = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";

But with and without the behaviour isn't changing at all.

@kMutagene
Copy link
Collaborator

is this done from C#? If so, i guess the FSharpOption is wrapped incorrectly when you are assigning just a string.

@LucasNmn
Copy link
Author

is this done from C#? If so, i guess the FSharpOption is wrapped incorrectly when you are assigning just a string.

Yes, from C#

@LucasNmn
Copy link
Author

Hello. Do you have a solution yet.

@kMutagene
Copy link
Collaborator

kMutagene commented Jun 20, 2022

No i do not have a solution, i have no way of debugging your very specific issue in your very specific use case without any reproducible code.

But i have identified a possible problem in my last answer:

If so, i guess the FSharpOption is wrapped incorrectly when you are assigning just a string.

So i'd suggest trying to set an actual FSharpOption<string> like i suggested:

using Plotly.NET.CSharp;
using Plotly.NET.ImageExport;
using Microsoft.FSharp.Core;

var path = @"executable/path/to/chrome.exe";

FSharpOption<string> opt = FSharpOption<string>.Some(path);

Plotly.NET.ImageExport.PuppeteerSharpRendererOptions.localBrowserExecutablePath = opt;

Chart.Line<int,int,string>(
    x: new int[]{1,2,3,4},
    y: new int[]{1,2,3,4}
).SaveJPG(@"somewhere\test.jpg")

this works in a notebook without issues, so any problems here are specific to your use case in IIS, and might be related to your application not having the rights to use the chromium instance

@kMutagene
Copy link
Collaborator

Closing this until we get either feedback or reproducible code

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

2 participants