Connection lost when attempting to upload a new profile picture or cover picture

  • NodeBB version: 1.10.2
    MongoDB version: 4.0.4

    When I attempt to change either my profile pic or cover pic our forums responds with "Looks like your connection *** was lost, please wait while we try to reconnect." Which seems strange as every other aspect of the forums is working fine.

    The exact errors being thrown in the browser console are as follows (this appears twice, I assume the forums attempts twice before giving up): GET 503 (Service Unavailable)
    o.create @
    o @
    r.request @
    r.doPoll @
    i.poll @
    i.doOpen @ @ @
    i @
    i @ @
    (anonymous) @
    setTimeout (async)
    i.reconnect @
    i.onclose @
    (anonymous) @
    i.emit @
    i.onClose @
    (anonymous) @
    i.emit @
    i.onClose @
    i.onClose @
    ws.onclose @

    Is this an issue with our configuration of the forum software or is it a known issue? Note, I've tried using various image formats and made sure they were well within the file size limit. The logs and errors pages do not show any issues.

  • Global Moderator Plugin & Theme Dev

    Are there any errors in the NodeBB server logs?

  • The only error I see is:

    2018-12-05T06:59:42.441Z [24245] - error:  message=Cannot find module '../build/Release/sharp.node', stack=Error: Can                                                                                                                        not find module '../build/Release/sharp.node'

    Nothing else.

  • Global Moderator Plugin & Theme Dev

    That is what is causing the issue I think. What os and node version are you using?

  • On Debian 9, a Digital Ocean droplet.

  • NodeBB Admin

    What nodejs version? Last time I tried sharp didn't have binaries for node11, not sure if it has now.

  • We're using NodeJS version 11.3.0

    If there isn't a compatible sharp module, is there an alternative we can use so that we can keep using the picture uploading?

  • NodeBB Admin

    Can you switch to node 10.x until it is added?

  • We'll give that a shot.

  • NodeBB Admin

  • Unfortunately, after downgrading NodeJS to 10.14.2 we still get the same error on the upload screen. As for using the upload by URL option, we get the "misconfigured CORS" error, which seems unrelated.

  • NodeBB Admin

    Did you run npm install after downgrading node?

  • Yes, npm install was run afterwards

  • After more testing with both the direct upload and URL upload, I am even more confused. The direct upload is still not working but when I try the URL upload I get different error messages depending on the browser I use. Note the image I am uploading is coming from using https and the latest versions of the respective browsers.

    • Chrome: "Unable to upload image due to misconfigured CORS"

    • Edge: "SecurityError"

    • IE 11: "SecurityError"

    • Firefox: "The operation is insecure."

    • Opera: "Unable to upload image due to misconfigured CORS"

    The inconsistencies are frustrating, any suggestions on what is causing this?

  • I had this problem as well, also impacted image uploading in messages.

    First updated to the newest nodebb release (1.11.0) and Node.js stable @ (11.2).

    Tried to downgrade Node.js back to (10.12) with no love.

    Returned to Node.js stable (11.2), and fixed by simply building sharp locally.

    npm install --build-from-source sharp


  • @Anjin That worked! Holy cow it worked! Thank you for that.

  • I run into this problem as well, and I fixed it by simply npm install --build-from-source sharp, FYI.

Suggested Topics

| | |

© 2014 – 2022 NodeBB, Inc. — Made in Canada.