Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Problem with bot authentication

I am trying to follow the Developing Bots using BDK for Python, but I'm having a problem when I try to run the bot using command py -m src
I am getting the error below.
2021-11-19 19:28:48,363 - symphony.bdk.core.auth.bot_authenticator - INFO - Retrying symphony.bdk.core.auth.bot_authenticator.BotAuthenticatorRsa._authenticate_and_get_token in 64.0 seconds as it raised ClientConnectorError: Cannot connect to host develop2.symphony.com:8443 ssl:default [Connect call failed ('35.196.115.60', 8443)].

There is a point during the lesson where Vinay says to ignore the RSA key generated, and to use the one provided. For a beginner like me, it's far from clear what he means by this. What does it mean to "ignore" the key generated? What does "use the key provided" mean? Provided by whom? And what do I need to do to "use" those "provided" keys? I think Vinay needs to spend a bit more time expplaining these things, as I can assume that authentication is probably the number 1 reason for bots' failure to connect. For beginners like me, it kills the excitement of the lesson if I can't connect and follow the tutorial by actually doing things.

The one thing I have done which has sort of helped a little bit was to specify port 8843 at the root of the config file. Initially it was complaingin about port 443, and it wasn't getting anywhere close to starting. Now, at least, it does the initial steps, and fails when it comes to Starting the datafeed loop, as you can see below:

(env) C:\Users\Blessing\OneDrive\Symphony\PythonBDK\bots\orders-bot>py -m src
2021-11-19 21:54:18,232 - root - INFO - Running bot application...
2021-11-19 21:54:18,233 - asyncio - DEBUG - Using selector: SelectSelector
2021-11-19 21:54:18,382 - symphony.bdk.core.activity.registry - DEBUG - Registering new activity <src.activities.EchoCommandActivity object at 0x00000212FF7EB340>
2021-11-19 21:54:18,382 - symphony.bdk.core.activity.registry - DEBUG - Registering new activity <src.activities.GreetUserJoinedActivity object at 0x00000212FF7EB3A0>
2021-11-19 21:54:18,390 - symphony.bdk.core.activity.registry - DEBUG - Registering new activity <src.gif_activities.GifSlashCommand object at 0x00000212FF7EB400>
2021-11-19 21:54:18,395 - symphony.bdk.core.activity.registry - DEBUG - Registering new activity <src.gif_activities.GifFormReplyActivity object at 0x00000212FF7EB430>
2021-11-19 21:54:18,396 - symphony.bdk.core.activity.registry - DEBUG - Registering slash command with command=/hello, mention_bot=True
2021-11-19 21:54:18,397 - symphony.bdk.core.activity.registry - DEBUG - Registering new activity <symphony.bdk.core.activity.command.SlashCommandActivity object at 0x00000212FF7EB550>
2021-11-19 21:54:18,398 - symphony.bdk.core.service.datafeed.abstract_datafeed_loop - DEBUG - Starting datafeed loop
2021-11-19 21:54:39,579 - symphony.bdk.core.auth.bot_authenticator - INFO - Retrying symphony.bdk.core.auth.bot_authenticator.BotAuthenticatorRsa._authenticate_and_get_token in 2.0 seconds as it raised ClientConnectorError: Cannot connect to host develop2.symphony.com:8443 ssl:default [Connect call failed ('35.196.115.60', 8443)].
2021-11-19 21:55:02,671 - symphony.bdk.core.auth.bot_authenticator - INFO - Retrying symphony.bdk.core.auth.bot_authenticato
Votes Newest

Answers 4


When you first registered on the Developer Center, you should have received a welcome email. Within that email, there is a link you can click on to request for sandbox credentials. You will then receive a package that includes the account details, the RSA keys and a sample configuration.

On configuration for the sandbox (develop2.symphony.com), the default port value of 443 is actually correct. Port 8443 is used for certificate authentication that is (as mentioned in the course) deprecated and not supported on the sandbox. If you are unable to connect to 443, it could be a problem with your internal network. e.g. you require an internet proxy.

We recommend that the sandbox be used with a personal device with open internet so as not to have corporate device/network restrictions impede your learning journey. If you have to use your corporate device on an internal network, you will need to seek advice from your internal network/infrastructure team on the connectivity requirements. You can find a full list of configuration parameters for BDK (Python) on this page: https://symphony-bdk-python.finos.org/markdown/configuration.html#full-configuration-example

  
  
Posted 2 years ago
Edited 2 years ago
Yong Sheng Tan
39 × 2 Administrator

Thanks Yong for your quick response! Let me follow your instructions, and I will update on here how things go.

  
  
Posted 2 years ago

I have confirmed I have no proxy configured anywhere on my home network (I would have been surprised if there was). I have checked using Internet Explorer> Internet options>Connections>LAN Settings. I have also checked with commandline netsh winhttp show proxy, and it clearly says " Direct access (no proxy server)." Yet I'm still unable to connect. The thing is, when I try to connect with default port 443, the system bombs out completely with the below error on trying to start the datafeed:

File "C:\Users\Blessing\OneDrive\Symphony\PythonBDK\bots\orders-bot\env\lib\site-packages\aiohttp\connector.py", line 990, in wrapcreateconnection
    raise ClientConnectorSSLError(req.connectionkey, exc) from exc
aiohttp.clientexceptions.ClientConnectorSSLError: Cannot connect to host develop2.symphony.com:443 ssl:default [Cannot create a client socket with a PROTOCOLTLSSERVER context (ssl.c:801)]

However, if I put port 8433, the system repeatedly tries to connect, but gets the below error:

2021-11-26 20:46:46,748 - symphony.bdk.core.activity.registry - DEBUG - Registering new activity <symphony.bdk.core.activity.command.SlashCommandActivity object at 0x00000194EF8AF520>
2021-11-26 20:46:46,749 - symphony.bdk.core.service.datafeed.abstractdatafeedloop - DEBUG - Starting datafeed loop
2021-11-26 20:47:07,910 - symphony.bdk.core.auth.botauthenticator - INFO - Retrying symphony.bdk.core.auth.botauthenticator.BotAuthenticatorRsa.authenticateandgettoken in 2.0 seconds as it raised ClientConnectorError: Cannot connect to host develop2.symphony.com:8443 ssl:default [Connect call failed ('35.196.115.60', 8443)].
  
  

443 is the correct port. What you're seeing here is that your Python instance does not trust the TLS certificate served on develop2.symphony.com. Can you confirm if your config.yaml contains a truststore? It is included if you used the Symphony Generator.

Yong Sheng Tan   2 years ago Report

The config file is as below. It's the one I got from the sandbox details sent by email. I just overwrote the default one created by the generator. I also copied the RSA files into the RSA folder, to match the config file.

host: develop2.symphony.com
bot:
    username: devcertbot1895
    privateKey:
        path: rsa/devcertbot1895-private.pem
  
  

Try including the truststore in your config like so:

host: develop2.symphony.com
bot:
    username: devcertbot1895
    privateKey:
        path: rsa/devcertbot1895-private.pem
ssl:
  trustStore:
    path: resources/all_symphony_certs...
Yong Sheng Tan   2 years ago Report
2K Views
4 Answers
2 years ago
2 years ago
Tags