element-hq / element-hq/synapse

synapse.app.admin_cmd produces CRITICAL - sentinel - main function encountered error

Open
#11,562 0 comments 0 reactions 0 assignees View on GitHub
P4 S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#11562](https://github.com/matrix-org/synapse/issues/11562).

---

### Description

I tried running the `synapse.app.admin_cmd` to export the data for one of my users, but got the following error:

```
2021-12-12 17:09:12,104 - twisted - 275 - CRITICAL - sentinel - main function encountered error
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/twisted/internet/defer.py", line 662, in callback
self._startRunCallbacks(result)
File "/usr/local/lib/python3.8/site-packages/twisted/internet/defer.py", line 764, in _startRunCallbacks
self._runCallbacks()
File "/usr/local/lib/python3.8/site-packages/twisted/internet/defer.py", line 858, in _runCallbacks
current.result = callback( # type: ignore[misc]
File "/usr/local/lib/python3.8/site-packages/twisted/internet/defer.py", line 1751, in gotResult
current_context.run(_inlineCallbacks, r, gen, status)
--- ---
File "/usr/local/lib/python3.8/site-packages/twisted/internet/defer.py", line 1661, in _inlineCallbacks
result = current_context.run(gen.send, result)
File "/usr/local/lib/python3.8/site-packages/synapse/app/admin_cmd.py", line 241, in run
await args.func(ss, args)
File "/usr/local/lib/python3.8/site-packages/synapse/app/admin_cmd.py", line 80, in export_data_command
res = await hs.get_admin_handler().export_user_data(
File "/usr/local/lib/python3.8/site-packages/synapse/handlers/admin.py", line 174, in export_user_data
events = await filter_events_for_client(self.storage, user_id, events)
File "/usr/local/lib/python3.8/site-packages/synapse/visibility.py", line 259, in filter_events_for_client
return [ev for ev in filtered_events if ev]
File "/usr/local/lib/python3.8/site-packages/synapse/visibility.py", line 259, in
return [ev for ev in filtered_events if ev]
File "/usr/local/lib/python3.8/site-packages/synapse/visibility.py", line 149, in allowed
oldest_allowed_ts = storage.main.clock.time_msec() - max_lifetime
builtins.AttributeError: 'AdminCmdSlavedStore' object has no attribute 'clock'
```

### Steps to reproduce

I just ran the following command in the main synapse Docker-Container on my Server:

```
python -m synapse.app.admin_cmd -c /data/homeserver.yaml export-data @user:my.server.com
```

### Version information

- **Homeserver**: matrx.sp-codes.de

If not matrix.org:

- **Version**: 1.48.0

- **Install method**: Docker

- **Platform**: Debian

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.