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
Feed was set to stale when running BDK bot for python

hi,
I am following the Developing Bots using BDK for Python.
I have an unexpected pb when I run the bot using command python -m src

I am getting the error below.

2022-04-04 09:06:02,575 - symphony.bdk.core.service.datafeed.abstract_datafeed_loop - DEBUG - Starting datafeed loop
2022-04-04 09:06:06,191 - symphony.bdk.core.service.datafeed.datafeed_loop_v2 - INFO - Retrying symphony.bdk.core.service.datafeed.datafeed_loop_v2.DatafeedLoopV2._read_datafeed in 2.0 seconds as it raised ApiException: (400)
Reason: 
HTTP response headers: <CIMultiDictProxy('Server': 'nginx', 'Date': 'Mon, 04 Apr 2022 07:07:07 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '92', 'Connection': 'keep-alive', 'X-Trace-Id': '38ZrmK:933hdD', 'P3P': 'CP="Symphony does not have a P3P policy"', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS, HEAD', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Strict-Transport-Security': 'max-age=31536000 ; includeSubDomains', 'X-Frame-Options': 'DENY', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block')>
HTTP response body: {"code":400,"message":"Feed was set to stale","details":{"message":"Feed was set to stale"}}

The bot responds to a /hello command, but still seems offline (grey tick on his avatar icon) and there is no datafeed id on the terminal.

2022-04-04 12:19:21,011 - root - DEBUG - Message received from : <div data-format="PresentationML" data-version="2.0" class="wysiwyg"><p><span class="entity" data-entity-id="0">@Dev Cert Bot ****</span> /hello</p></div>

BDK is 2.0

  
  
Posted 2 years ago
Edited 2 years ago
1
1

@<1421175538445193216|azeem malik>when providing additional information to a question, please edit your original question or use this comments feed instead of adding an answer, unless you have found the answer to your own query and would like to share your solution.

Yong Sheng Tan   2 years ago Report
Votes Newest

Answers


This happens when your bot is configured to use Datafeed 2.0 and has created a datafeed, but was not continuously running for some time so the datafeed became stale.

The BDK will automatically re-create a new datafeed and begin listening on the new one after those log messages. As long as the bot is responding to events like commands, everything is working correctly. If you terminate the bot process and restart it, you will notice that the exception no longer occurs, since your previous run already created a new datafeed. The Python BDK as of version 2.3.0 defaults to using Datafeed 2.0, which does not persist a datafeed.id file to disk. Instead, all datafeeds are stored in the Symphony Cloud to improve bot resilience.

As for presence, your bot should appear online as soon as your bot process starts up and the datafeed loop begins.

  
  
Posted 2 years ago
Edited 2 years ago
Yong Sheng Tan
39 × 2 Administrator
2K Views
1 Answer
2 years ago
2 years ago
Tags