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):

    socket.io.js:7 GET https://forums.WEBSITE.com/socket.io/?EIO=3&transport=polling&t=MT_KUlp 503 (Service Unavailable)
    o.create @ socket.io.js:7
    o @ socket.io.js:7
    r.request @ socket.io.js:7
    r.doPoll @ socket.io.js:7
    i.poll @ socket.io.js:7
    i.doOpen @ socket.io.js:7
    i.open @ socket.io.js:7
    i.open @ socket.io.js:6
    i @ socket.io.js:6
    i @ socket.io.js:6
    i.open.i.connect @ socket.io.js:6
    (anonymous) @ socket.io.js:6
    setTimeout (async)
    i.reconnect @ socket.io.js:6
    i.onclose @ socket.io.js:6
    (anonymous) @ socket.io.js:7
    i.emit @ socket.io.js:6
    i.onClose @ socket.io.js:6
    (anonymous) @ socket.io.js:6
    i.emit @ socket.io.js:6
    i.onClose @ socket.io.js:7
    i.onClose @ socket.io.js:7
    ws.onclose @ socket.io.js:7
    

    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

    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

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



  • On Debian 9, a Digital Ocean droplet.


  • 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?


  • Admin

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



  • We'll give that a shot.


  • 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.


  • 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 imgur.com 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
    

    Cheers
    Anjin



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


Log in to reply
 

Suggested Topics

  • 8
  • 22
  • 6
  • 18
  • 1
| |