Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 2 1 1

Error when setting App key

Hi everyone,

I used to be able to run scripts without errors, but lately have an issue with setting the app key. In particular I get the following error logging message:

2020-04-29 18:10:05,511 P[76044] [MainThread 76048] Response : 500 - {"code":500,"message":"Cannot find module \".\"","statusMessage":"Internal Server Error"}

2020-04-29 18:10:05,512 P[76044] [MainThread 76048] Port 9000 was retrieved from .portInUse file

2020-04-29 18:10:05,513 P[76044] [MainThread 76048] Try to handshake on url http://localhost:9000/api/handshake...

2020-04-29 18:10:05,517 P[76044] [MainThread 76048] Response : 400 - Handshake payload is invalid.

2020-04-29 18:10:05,518 P[76044] [MainThread 76048] Set Proxy port number to 9000


The according error message is:

return super(DesktopSession, self).close()

TypeError: super(type, obj): obj must be an instance or subtype of type



My Eikon app is open and I did not change any of my python environments since last my last use. I am using eikon 1.1.2.


Thanks in advance for your answer!

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiapp-key
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@adrien.weihs

Thank you for your participation in the forum.


Is the reply below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.


Thanks,

AHS

Hello @adrien.weihs

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hello @adrien.weihs,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hello @adrien.weihs

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

@adrien.weihs

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Show more comments
Upvotes
Accepted
4.3k 2 4 5

Hi Adrien,

Your code is very simple. It seems that you're facing to a very specific case that I can't explain. It could be caused by a mismatch in your Python environment with eikon versions. I also noted that your Eikon version isn't recent : 4.0.49 (versus 4.0.51)

I suggest to test with refinitiv-dataplatform library.
It should replace eikon in next months and is available as alpha version on pypi: https://pypi.org/project/refinitiv-dataplatform/

You'll just have to update your code :

import eikon as ek
import logging.config 
ek.set_log_level(logging.DEBUG)
ek.set_app_key(XXXXXXX)

to

import refinitiv.dataplatform as ek
import logging.config

ek.set_app_key(XXXXXXX) ek.get_default_session().set_log_level(5)

Notes that as this library is not released, few changes could be done in next versions, but eikon legacy functions you're using are maintened.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
17.3k 82 39 63

Hi @adrien.weihs,

As a quick test, can you restart Eikon?

There have been similar reports in the past:

https://community.developers.refinitiv.com/questions/50003/500-internal-server-error-1.html

https://community.developers.refinitiv.com/questions/25268/httperror-backend-error-500-internal-server-error.html

I would encourage you to search the forums for similar issues/resolutions.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 2 1 1

Dear Nick,

It goes without saying that I have tried (several) times to restart my eikon application. I am a bit surprise that you "encourage me to look for other solutions", when In particular, if I am not mistaken, the links you provided me with, do not describe a way of solving the problem but only refer to checking the alerts tab.

Adrien


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @adrien.weihs,

Unfortunately the server 500 error is nonsensical. The suggestion to look for Alerts may have explained some issues in the backend causing this unexpected behaviour you are seeing. I’m assuming you are completely shut out. Can you send me your appkey? If you haven’t already, can you generate a new appkey and try that? I will continue my investigation. Thanks for your patience.

Hi Nick,

Thank you for coming back to me and opening a ticket. I have also tried to use a new App key, which unfortunately did not work. Is there a secure way to send you my app key? What do you mean when saying "completely shut out"? Is that something I would need to discuss with the sales representative?

Also, I believe that I have Eikon 4.0.52.

Adrien


Hi @adrien.weihs,

I have opened up a support ticket. Can you provide the version of Eikon you are using? I know you have had success with your current version of Eikon but the recommendation was to ensure you have at least version 4.0.36.

Upvote
4.3k 2 4 5

Hi

Following error messages arn't critical:

2020-04-29 18:10:05,511 P[76044] [MainThread 76048] Response : 500 - {"code":500,"message":"Cannot find module \".\"","statusMessage":"Internal Server Error"}
2020-04-29 18:10:05,512 P[76044] [MainThread 76048] Port 9000 was retrieved from .portInUse file
2020-04-29 18:10:05,513 P[76044] [MainThread 76048] Try to handshake on url http://localhost:9000/api/handshake...
2020-04-29 18:10:05,517 P[76044] [MainThread 76048] Response : 400 - Handshake payload is invalid.

It's related to different connection attempts to the Eikon proxy for backward compatibility with all proxy versions.

What is important is to have the message:

2020-04-29 18:10:05,518 P[76044] [MainThread 76048] Set Proxy port number to 9000

That means the connection is successful.

In a second step, you have this exception :

return super(DesktopSession, self).close()
TypeError: super(type, obj): obj must be an instance or subtype of type

I understand it's reproduced all times.
Could you activate logs before the call to set_app_key and share the log (without user info like app_key) ?
(add ek.set_log_level(5) to have all levels)

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi Pierre,

Thank you for coming back to me and the explanation of the backward compatibility procedure.

Indeed, the exception is reproduced at all times. I have now followed your advice and activated the log with the extra log_level command (before the app key step) and get exactly the same log (and exception as above):

2020-05-04 08:37:54,663 P[76044] [MainThread 76048] Set App Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

2020-05-04 08:37:54,670 P[76044] [MainThread 76048] Response : 500 - {"code":500,"message":"Cannot find module \".\"","statusMessage":"Internal Server Error"}

2020-05-04 08:37:54,671 P[76044] [MainThread 76048] Port 9000 was retrieved from .portInUse file

2020-05-04 08:37:54,673 P[76044] [MainThread 76048] Try to handshake on url http://localhost:9000/api/handshake...

2020-05-04 08:37:54,677 P[76044] [MainThread 76048] Response : 400 - Handshake payload is invalid.

2020-05-04 08:37:54,679 P[76044] [MainThread 76048] Set Proxy port number to 9000


Do you have any other suggestions?

Adrien

Hi Adrien,

Unfortunately, logs won't be useful in your case because the connection looks like successful.

Could you share the code that leads to the following exception ?

return super(DesktopSession, self).close()
TypeError: super(type, obj): obj must be an instance or subtype of type

In addition, could you check DESKTOPSXSSVC and PROXY versions in the Eikon \ Help \ About Thomson Reuters window ?


help-about-apps.jpg (123.4 KiB)

Hi Pierre,

This is also what I suspected regarding the logs.


The code I am using is quite straight-forward really:


import eikon as ek

import logging.config

ek.set_log_level(logging.DEBUG)

ek.set_log_level(5)

ek.set_app_key(XXXXXXXXXXXXXXXXXXXXXX)


Please find my Eikon version attached as well.


Adrien


tr-about.png (102.5 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.