qlik-oss / sse-r-plugin

A Qlik server-side extension plugin for accessing R.
MIT License
66 stars 73 forks source link

Qlik failing to connect to sse plugin #40

Open phealeyh opened 6 years ago

phealeyh commented 6 years ago

Description

Qlik sense server is failing to connect to the SSE server on the same machine.

Steps to Reproduce

  1. Start RServe running on 6311 in RGUI on x machine
  2. Run SSE-R plugin extension with default settings pointing to Rserve on x machine
  3. Add analytic connection on x machine (running Qlik Server that points to SSE server using local connection and port 50051)
  4. Restart Qlik engine
Expected behavior

[What you expected to happen] I expected the Qlik server to successfully connect to the SSE-R server.

Actual behavior

[What actually happened]

Qlik fails to connect to the SSE server and produces an error within the trace log folder. The file is SSE_ENGINE and produces an error code 14 when trying to establish to the SSE server.

'New SSEPlugin added (secure connection). Name: R, address: 127.0.0.1:50051 0' then produces a warning: 'Failed for 127.0.0.1:50051 error code : 14 0 Internal Engine' then produces another warning: 'Failed to initialize gRPC communication for SSEPlugin R 0 Internal'

Environment

Operating system where the SSE plugin is deployed
[ ] Windows Server 2016 Datacenter 64-bit(10.0, Build 14393)
##### Qlik Sense Feburuary 2018 Patch 1 - 12.5.3

[ ] Server


### Versions

* sse-r-plugin:
* Qlik Sense: 1.2.1-qlik-oss

### Note
I have all the ports opened for 50051, 6311 and all the ports that the Qlik server uses within the firewall. Yet the Qlik server is still failing to establish a connection to the SSE server.
tobiaslindulf commented 6 years ago

Hi, According to the logs it seems like you have initiated a secure connection, so the Analytic connection configuration in the QMC (or engine settings.ini file) may have a certificate path set. If you want to run unsecure connection then make sure the certificate path setting is completely empty and then restart the engine service just to be sure. If you want to run secure connection then make sure to point to the correct certificates in the config (as well as in the SSE plugin). The easiest is if you try unsecure first since it is local host anyway.

phealeyh commented 6 years ago

Hi tobiaslindulf,

Thank you for the quick reply! I actually have three analytic connections that both point to the sse server (the sse server was insecurely connected to the R serve at the time of writing) with my settings.ini completely empty this whole time.

The whole log actually produces this for all 3 of my analytic connections:

  1. New SSEPlugin added (non-secure connection). Name: test Failed for localhost:50051 error code : 14 0 Failed to initialize gRPC communication for SSEPlugin test 0

    2.New SSEPlugin added (non-secure connection). Name: test2 Failed for 127.0.0.1:50051 error code : 14 0 Internal Failed to initialize gRPC communication for SSEPlugin test2 0

  2. New SSEPlugin added (secure connection). Name: R, address: 127.0.0.1:50051 0 Failed for 127.0.0.1:50051 error code : 14 0 Internal Engine Failed to initialize gRPC communication for SSEPlugin R 0 Internal Engine

All three analytic connections are failing.

Thank you for the help!

Kind Regards,

Phealey Hang

phealeyh commented 6 years ago

Does anyone also know whether 'error code 14' within the SSE engine log(found within the trace folder for qlik directory) is produced by the sse server or qlik server? I have been told that the SSE server generates this error when a connection has failed to establish and is then logged by the qlik engine. So does the SSE server relay this failure back to qlik and then logged into the sse engine log file as 'error code 14'?

Kind Regards, Phealey Hang

josefinestal commented 6 years ago

Hi @phealeyh ! The error codes in the SSE log file are referring to the gRPC status codes (see here). Number 14 equals unavailable and is typically seen when the connection has failed, as you said, for instance when Qlik tries to get the capabilities from the SSE plugin and the plugin is not yet started.

Error messages in the logs can come both from within Qlik (as in the case above) but also from the plugin. In the Writing an SSE plugin using Python guide there is a short section about error handling from the plugin side. You can also look in the system engine log file to get more information about the specific event. For instance, in the event described above, you will have a log message saying "GetCapabilities: Failed for \<host>:\<port> error code : 14"

I hope this helped you, let me know if you have any further questions!

Kind regards, Josefine

phealeyh commented 6 years ago

If I understand this correctly, GetCapabilities returns all of the functions that qlik can use for the R plugin? Can you suggest reasons why the connection is failing? I'm really stumped on what could be causing this problem.

Kind Regards,

Phealey Hang

josefinestal commented 6 years ago

Yes, that's correct. GetCapabilites also returns a boolean for enabling script evaluation as well as an identifier and version of the plugin (see the Capabilities section in the documentation).

I would say the most common mistake for a failing connection is that the configuration does not align with the settings in the plugin (or where the plugin is run).

The first thing you should do is to:

Also, every plugin you configure should have its own unique port. I noticed all three plugins in your comment further up, are configured to use the same port 50051. With this configuration, only the first plugin connecting to the port will get the GetCapabilities call(given the configuration is correct). For simplicity, I would suggest you start with one plugin and make sure you get that to work before adding more.

josefinestal commented 6 years ago

Hi again @phealeyh ! I want to clarify the last part of my comment regarding plugins with a unique port. It should work fine to configure several plugins in Sense, pointing to the same SSE server (and hence the same port). However, configurations pointing to the same port must have the same setting regarding insecure/secure connections. I misunderstood you and thought you had multiple SSE servers which you pointed to the same port. I apologize for any potential confusion.

Kind regards, Josefine

Saiprasad05 commented 5 years ago

Hi @phealeyh , i am facing the same issue. Kindly let me know whether this issue has been resolved for you.

Regards, Saiprasad

michael-motion commented 2 years ago

How would I resolve this "GetCapabilities: Failed for : error code : 14? Is there another version of the sse-r-plugin-master? I attempted to run the SSEtoServe in Visual Studion to compile it. I am not running the plugin securely in the QMC so no certificates. Do you have any other suggestion in order to get this resolved?