Page MenuHomePhabricator

TypeError: Cannot read property 'mediawikiId' of null
Open, LowPublicBUG REPORT

Description

What happens?:
Encounters this error

[1] file:///app/server/controllers/socket-controller.js:5
[1]             UserModel.updateOne({ mediawikiId: data.mediawikiId }, { $set: { socketId: socket.id } })
[1]                                                     ^
[1]
[1] TypeError: Cannot read property 'mediawikiId' of null

Possible Scenarios:
This happens when the developer has not entered the CLIENT_ID or CLIENT_SECRET, in the required place. Do refer the README.md, for storing the keys.

Possible Solutions:

  • Store the keys in their respective place, as mentioned in the README.md.
  • If you have stored the keys, and the error still persists, try opening the tool, on the icongnito mode.
  • This can also happen when you have some extensions in your browser (Ex: MetaMask), which clears up your localstorage of the browser, and so the keys are not passed to the client.

Do check your localstorage, for these keys.

Event Timeline

This is a phabricator ticket, for those who are facing this error. Possible solutions are added in the description.
If there are any more solutions to this, please mention them below, so that new developers can follow this ticket, if they face this.

Reputation22 triaged this task as Low priority.
Soda subscribed.

Lets not decline this :)

Lets not decline this :)

is there any way we can pin this one..so that its easily available to new users?

Not really, best to add a link to this in the README ? (Or maybe better to document this specific instance in the README itself)

  • We must consider these points while adding into Readme:
  • Any extension which clears the cookies and localStorage (eg: Metamask Wallet) shouldn't be installed into the browser.
  • Remove the CLIENT_ID and CLIENT_SECRET, as user cannot create docker without it at first place.

Change 900753 had a related patch set uploaded (by Reputation22; author: Reputation22):

[labs/tools/VideoCutTool@master] Update README.md

https://gerrit.wikimedia.org/r/900753

Change 900753 merged by jenkins-bot:

[labs/tools/VideoCutTool@master] Update README.md

https://gerrit.wikimedia.org/r/900753