Skip to content

Orca.exe hangs on write_image, freezes up and I have to kill the process. #1460

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

Closed
rsherman726 opened this issue Mar 11, 2019 · 3 comments
Closed

Comments

@rsherman726
Copy link

When I run the following code it hangs indefinitely.

Plotly.io.write_image(fig, self.save_path + '/' + self.save_name + '_Scree.jpg')

If I wrap the write_image with a Try, it will not move off the code below to show me any errors.

plotly.io.orca.config.executable = 'C:\inetpub\wwwroot\MProd360\Python\orca\orca.exe'
Note: orca.exe is launched fine.

All other code before the write_Image executes fine.

Background: I am calling the python code from an asp.net application.
I have run the write_image code from two other personal web servers without hanging.
I moved the code to a server hosted on a Go Daddy dedicated server and I then get the hanging behavior.

Also, If I run the code purely within a Python project in Visual Studio on the Go Daddy server it runs without hangings as well.

public string run_Python(string sCMD, string sAgs1, string sArgs2)
{
string result = "";

    ProcessStartInfo start = new ProcessStartInfo();
    start.FileName = "C:\\Program Files\\Python37\\python.exe";
    start.Arguments = sCMD + " " + sAgs1 + " " + sArgs2;
    start.UseShellExecute = false;// Do not use OS sarg2
    start.CreateNoWindow = true; // We don't need new window
    start.RedirectStandardOutput = true;// Any output, generated by application will be redirected back
    start.RedirectStandardError = true; // Any error in standard output will be redirected back (for example exceptions)
    using (Process process = Process.Start(start))
    {
        using (StreamReader reader = process.StandardOutput)
        {
            string stderr = process.StandardError.ReadToEnd(); // Here are the exceptions from our Python script
            if (stderr != "")
            {
                result = stderr;
            }
            else
            {
                result = reader.ReadToEnd(); // Here is the result of StdOut(for example: print "test")
            }
            Debug.WriteLine("*****************************************************");
            Debug.WriteLine("*****************************************************");
            Debug.WriteLine(result);
            Debug.WriteLine("*****************************************************");
            Debug.WriteLine("*****************************************************");


            return result;
        }
    }
}
@jonmmease
Copy link
Contributor

Hi @rsherman726,

The only thing that comes to mind is that perhaps the Windows Defender firewall is blocking the use of the port that plotly.py is choosing to communicate with orca. For testing, see if you can disable the firewall. If you can open up particular ports in the firewall you can tell plotly.py to use a specific port by setting

plotly.io.orca.config.port = 8123

@rsherman726
Copy link
Author

The server is Windows Server 2012, they didn't have defender back then, it came out with the Windows server 2016.

@rsherman726
Copy link
Author

No firewall is in use.

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