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

brainbox crash: TypeError: Cannot read property 'dirname' of undefined #303

Open
ntraut opened this issue Nov 4, 2021 · 1 comment
Open
Labels

Comments

@ntraut
Copy link
Member

ntraut commented Nov 4, 2021

Thank you for your feedback.

Please tag your issue as a feature request or a bug report using the labels on the right.

Current behaviour

  • If this is a bug, please explain how to reproduce the problem
    • Which tools did you use in which sequence?
    • Is the error concerning a text or a volume annotation?
    • Which label set has been used for the volume annotation (if applicable)?
    • What is the type and resolution of your data? (Can you provide a link to your data?)
    • Do not include sensitive information.
    • Upload the browser error message if you are familiar with web developer tools.

Not sure exactly how this happens but brainbox often crashes at this line:

const brainPath = sourceUS.User.dirname + sourceUS.User.mri;

traceback:

TypeError: Cannot read property 'dirname' of undefined
    at Object.receiveRequestSliceMessage (/var/www/html/brainbox/controller/atlasmakerServer/atlasmakerServer.js:1132:39)
    at Object._handleUserWebSocketMessage (/var/www/html/brainbox/controller/atlasmakerServer/atlasmakerServer.js:1809:12)
    at Object._handleWebSocketMessage (/var/www/html/brainbox/controller/atlasmakerServer/atlasmakerServer.js:1952:10)
    at WebSocket.<anonymous> (/var/www/html/brainbox/controller/atlasmakerServer/atlasmakerServer.js:2041:12)
    at WebSocket.emit (events.js:210:5)
    at Receiver.receiverOnMessage (/var/www/html/brainbox/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:210:5)
    at Receiver.dataMessage (/var/www/html/brainbox/node_modules/ws/lib/receiver.js:422:14)
    at Receiver.getData (/var/www/html/brainbox/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/var/www/html/brainbox/node_modules/ws/lib/receiver.js:138:22)

we could think that it happens when me.getUserFromUserId(data.uid) returns null but it should not be the case because we would have the following error: Uncaught TypeError: Cannot read property 'User' of null

so it must be when getUserFromUserId returns an object without a User property

Expected behaviour

brainbox would handle the problem and not crash

Version information (for bug reports)

current

@ntraut ntraut added the bug label Nov 4, 2021
@ntraut
Copy link
Member Author

ntraut commented Nov 9, 2021

Looking at the code in atlasmakerServer.js, the new entry in me.US is created in the method _connectNewUser but the property User is set in the method declareAutocompleteClient, so until the websocket message "autocompleteClient" is sent brainbox can crash because of the undefined property User.

@r03ert0 can you check that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant