Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot convert undefined or null to object when updating matrix-appservice-slack #341

Open
danrmiller opened this issue Jan 13, 2020 · 3 comments

Comments

@danrmiller
Copy link

Do I need to change anything if I have an already configured slack bridge using nedb going from version fddd3f9 to 61e9374? This is the error I get when I update:

systemd[1]: Started Matrix Appservice Slack server.
matrix-appservice-slack[10465]: Jan-13 04:21:08.284 WARN Main ** NEDB IS END-OF-LIFE **
matrix-appservice-slack[10465]: Jan-13 04:21:08.287 WARN Main Starting with version 1.0, the nedb datastore is being discontinued in favour of postgresql. Please see https://github.com/matrix-org/matrix-appservice-slack/blob/master/docs/datastores.md for more informmation.
matrix-appservice-slack[10465]: Jan-13 04:21:08.288 INFO Main Enabled RTM
matrix-appservice-slack[10465]: Jan-13 04:21:08.288 INFO Main Loading databases
matrix-appservice-slack[10465]: Jan-13 04:21:08.325 INFO Main Loading teams.db
matrix-appservice-slack[10465]: Jan-13 04:21:08.342 INFO SlackHookHandler Slack-side listening on port 9003 over http
matrix-appservice-slack[10465]: Jan-13 04:21:08.354 INFO bridge [-] GET http://matrix-synapse:8008/_matrix/client/r0/joined_rooms (AS) Body:
matrix-appservice-slack[10465]: Jan-13 04:21:08.358 INFO Main Fetching teams
matrix-appservice-slack[10465]: Jan-13 04:21:08.366 INFO Main Loaded 0 teams
matrix-appservice-slack[10465]: Jan-13 04:21:08.367 INFO Main Finished loading all team clients
matrix-appservice-slack[10465]: Jan-13 04:21:08.368 INFO Main Found 1 room entries in store
matrix-appservice-slack[10465]: Jan-13 04:21:08.372 INFO bridge [-] GET http://matrix-synapse:8008/_matrix/client/r0/joined_rooms (AS) HTTP 200 "{"joined_rooms": ["!amjcYQrFrNgMgXwbRU:MYDOMAIN", "!gFabpMwEtdkpmAALEd:
matrix-appservice-slack[10465]: Jan-13 04:21:08.373 INFO Main [1/1] Loading room entry !gFabpMwEtdkpmAALEd:MYDOMAIN
matrix-appservice-slack[10465]: /usr/src/app/lib/datastore/NedbDatastore.js:119
matrix-appservice-slack[10465]: delete doc._id;
matrix-appservice-slack[10465]: ^
matrix-appservice-slack[10465]: TypeError: Cannot convert undefined or null to object
matrix-appservice-slack[10465]: at /usr/src/app/lib/datastore/NedbDatastore.js:119:17
matrix-appservice-slack[10465]: at newArguments. (/usr/src/app/node_modules/nedb/lib/executor.js:29:17)
matrix-appservice-slack[10465]: at Cursor.execFn (/usr/src/app/node_modules/nedb/lib/datastore.js:520:14)
matrix-appservice-slack[10465]: at callback (/usr/src/app/node_modules/nedb/lib/cursor.js:126:19)
matrix-appservice-slack[10465]: at /usr/src/app/node_modules/nedb/lib/cursor.js:193:12
matrix-appservice-slack[10465]: at /usr/src/app/node_modules/nedb/lib/datastore.js:329:14
matrix-appservice-slack[10465]: at Object.async.eachSeries (/usr/src/app/node_modules/async/lib/async.js:130:20)
matrix-appservice-slack[10465]: at /usr/src/app/node_modules/nedb/lib/datastore.js:323:11
matrix-appservice-slack[10465]: at fn (/usr/src/app/node_modules/async/lib/async.js:582:34)
matrix-appservice-slack[10465]: at Immediate. (/usr/src/app/node_modules/async/lib/async.js:498:34)
matrix-appservice-slack[10465]: at processImmediate (internal/timers.js:439:21)
systemd[1]: matrix-appservice-slack.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: matrix-appservice-slack.service: Failed with result 'exit-code'.

@spantaleev
Copy link
Owner

In 61e9374, I've upgraded the appservice-slack bridge from the unofficial older release we were using to v1.0.2.

The NeDB deprecations are something we still need to fix in the future (making this bridge use Postgres).

Still, it should have been safe to upgrade to v1.0.2. It looks like the new version chokes on your database for some reason.

You can downgrade manually by specifying matrix_appservice_slack_docker_image: "cadair/matrix-appservice-slack:latest" in your vars.yml file.

If the problem is more widespread, we'd better downgrade the playbook for everyone.


In any case, we'd like to be on some official appservice-slack release, so it'd be nice if this gets fixed.
Looks like the error happens on a line introduced by this commit: matrix-org/matrix-appservice-slack@9c9db5b

Perhaps @Half-Shot or @Cadair can help out?

@Cadair
Copy link
Contributor

Cadair commented Jan 22, 2020

This looks like a bug which should be raised against the appservice repo.

@prasket
Copy link
Contributor

prasket commented Apr 25, 2020

the cadair/matrix-appservice-slack:latest was built 3 days ago and now I am seeing the same errors. I was able to get around this by reverting to the cadair/matrix-appservice-slack:cadair tagged docker build.

spantaleev added a commit that referenced this issue Apr 27, 2020
We've had reports of the `:latest` tag not working anymore,
leading to an error as described here:
#341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants