Comments (5)
Hello again a crash this morning
127.0.0.1 - - [19/Jun/2020 09:14:23] "GET / HTTP/1.1" 200 8707
[2020-06-19 10:53:28][ERROR] slack.rtm.client client.py:_dispatch_event:445 | When calling '#_on_user_change()' in the 'machine.clients.singletons.slack' module the following error was raised: missing value for field "deleted"
Traceback (most recent call last):
File "/home/supportbot/bot/lib/python3.6/site-packages/dacite/core.py", line 47, in from_dict
field_data = data[field.name]
KeyError: 'deleted'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/supportbot/bot/lib/python3.6/site-packages/dacite/core.py", line 59, in from_dict
value = get_default_value_for_field(field)
File "/home/supportbot/bot/lib/python3.6/site-packages/dacite/dataclasses.py", line 21, in get_default_value_for_field
raise DefaultValueNotFoundError()
dacite.dataclasses.DefaultValueNotFoundError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/supportbot/bot/bin/slack-machine", line 10, in <module>
sys.exit(main())
File "/home/supportbot/bot/lib/python3.6/site-packages/machine/bin/run.py", line 14, in main
bot.run()
File "/home/supportbot/bot/lib/python3.6/site-packages/machine/core.py", line 211, in run
self._dispatcher.start()
File "/home/supportbot/bot/lib/python3.6/site-packages/machine/dispatch.py", line 34, in start
self._client.start()
File "/home/supportbot/bot/lib/python3.6/site-packages/machine/clients/singletons/slack.py", line 118, in start
self.rtm_client.start()
File "/home/supportbot/bot/lib/python3.6/site-packages/slack/rtm/client.py", line 198, in start
return self._event_loop.run_until_complete(future)
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "/home/supportbot/bot/lib/python3.6/site-packages/slack/rtm/client.py", line 339, in _connect_and_read
await self._read_messages()
File "/home/supportbot/bot/lib/python3.6/site-packages/slack/rtm/client.py", line 390, in _read_messages
await self._dispatch_event(event, data=payload)
File "/home/supportbot/bot/lib/python3.6/site-packages/slack/rtm/client.py", line 440, in _dispatch_event
self._execute_in_thread(callback, data)
File "/home/supportbot/bot/lib/python3.6/site-packages/slack/rtm/client.py", line 465, in _execute_in_thread
future.result()
File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/supportbot/bot/lib/python3.6/site-packages/machine/clients/singletons/slack.py", line 82, in _on_user_change
user = self._register_user(payload['data']['user'])
File "/home/supportbot/bot/lib/python3.6/site-packages/machine/clients/singletons/slack.py", line 44, in _register_user
user = User.from_api_response(user_response)
File "/home/supportbot/bot/lib/python3.6/site-packages/machine/models/user.py", line 57, in from_api_response
return from_dict(data_class=User, data=user_reponse) # pragma: no cover
File "/home/supportbot/bot/lib/python3.6/site-packages/dacite/core.py", line 63, in from_dict
raise MissingValueError(field.name)
dacite.exceptions.MissingValueError: missing value for field "deleted"
from slack-machine.
@dandydev Again today
from slack-machine.
for these type of errors you can just make those fields in the user model optional.... ie in machine/models/user.py :-
@DataClass(frozen=True)
class User:
"""
User model that represents a user object from the Slack API
"""
id: str
team_id: Optional[str]
name: str
deleted: Optional[bool]
from slack-machine.
When generating the models, I also had a look at the API docs, which seemed to suggest that deleted
was always present. Apparently not though, so I'll fix that.
from slack-machine.
You can upgrade to v0.20 to get the fixes
from slack-machine.
Related Issues (20)
- Issue with slackclient 2.7.3 HOT 3
- Easy way to process "listen_to" and "respond_to" without duplicating the regex? HOT 2
- Slack api im.open method has been removed HOT 5
- Move to python-slack-sdk HOT 2
- Replace Travis CI with Github Actions HOT 1
- Move to Events API instead of RTM API HOT 1
- Replace implementations of `*_scheduled` methods with calls to `chat.scheduleMessage` HOT 1
- More flexible python requirements? HOT 1
- Allow user to provide their own logging configuration
- Remove HBase storage plugin HOT 1
- Error messages around user[data] and around ['data']['channel'] HOT 6
- Async support HOT 9
- Introduce structured logging HOT 2
- Add documentation on how to deploy slack-machine
- Add webhook functionality
- How do I set my bot user's icon? HOT 2
- Automatic releases HOT 2
- Can't change log level and use slack-machine logger HOT 2
- Auto-generate app manifests and optionally create Slack app through API
- Overhaul help texts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slack-machine.