image upload issues



  • Im having trouble with image uploads, and always get this:

    ERROR
    Something went wrong while parsing server response
    

    I also get this error when trying to delete orphaned images from the Manage/Uploads admin page:

    ×ERROR
    EACCES: permission denied, unlink '/var/www/vhosts/.../NodeBB/public/uploads/files/1540629625930-4c7e9f63-94d1-4d0f-a73b-9b77513956e1-image.png'
    

    maybe its a permissions issue
    the public folder in my install is owned by root, is that correct?



  • I fixed the deletion of orphaned files by changing file permissions on my NOdeBB install, but I still can't upload new images.


  • Global Moderator

    Nothing should be owned by root. NodeBB should not be installed or run as root. You should change all of the permissions with chown -r



  • im still getting 502 errors when trying to upload:

    [Error] Failed to load resource: the server responded with a status of 502 () (upload, line 0)
    
    https://support.sweetpproductions.com/api/post/upload
    


  • I managed to get the uploads working by adding the following to my Apache & nginx Settings on the Additional nginx directives in my Plesk Onyx panel:

    location / {
    	proxy_set_header X-Real-IP $remote_addr;
    	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    	proxy_set_header X-Forwarded-Proto $scheme;
    	proxy_set_header Host $http_host;
    	proxy_set_header X-NginX-Proxy true;
    
    	proxy_pass http://127.0.0.1:4567;
    	proxy_redirect off;
    
    	# Socket.IO Support
    	proxy_http_version 1.1;
    	proxy_set_header Upgrade $http_upgrade;
    	proxy_set_header Connection "upgrade";
    }
    


  • I recently upgraded from nodejs 9.10.1 to 10.15.0, and the problem has come back
    😞

    ERROR
    Something went wrong while parsing server response
    
    [Error] Failed to load resource: the server responded with a status of 502 () (upload, line 0)
    https://support.sweetpproductions.com/api/post/upload
    

  • Global Moderator

    @sweetp try running npm install and npm rebuild



  • @PitaJ still no luck 😞
    Im running on Centos 7 if that makes any difference


  • Global Moderator

    What was the output of npm rebuild?



  • here's the full output:

    I then also chown the NodeBB directory, then:

    systemctl stop nodebb
    systemctl start nodebb
    

    I have also update to NodeBB v1.1.2 and still have the same issue
    😞


  • Global Moderator

    Can you try npm rebuild --build-from-source



  • @PitaJ said in image upload issues:

    npm rebuild --build-from-source

    still get the error, unfortunately

    ERROR
    Something went wrong while parsing server response
    

  • Global Moderator

    When you run any of these commands, please include the command output! Just saying "it didn't work" doesn't help anyone.



  • ah, I didn't post, because it's virtually identical to the previous output:



  • I finally got the error fixed.
    here's what happened, I am running a Plesk Onyx server, and installed the NodeJS update according to this guide:

    And while everything looked good within Plesk, when I ran the command:

    node -v
    

    the old v8.9.1 of NodeJS would show as being current...

    so all I did was this:

    nvm use 10.15
    npm install
    npm rebuild
    

    now everything is finally running just fine again
    🙂



  • I have similar error.

    When an user try to upload an image the server respond with 503 error.
    I have started nodebb with nodebb dev and I get this error:

    019-02-11T15:41:06.941Z [1502] - error:  message=/lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /opt/app/node_modules/sharp/build/Release/../../vendor/lib/libpng16.so.16), stack=Error: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /opt/app/node_modules/sharp/build/Release/../../vendor/lib/libpng16.so.16)
        at Object.Module._extensions..node (module.js:664:18)
        at Module.load (module.js:554:32)
        at tryModuleLoad (module.js:497:12)
        at Function.Module._load (module.js:489:3)
        at Module.require (module.js:579:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (/opt/app/node_modules/sharp/lib/constructor.js:10:15)
        at Module._compile (module.js:635:30)
        at Object.Module._extensions..js (module.js:646:10)
        at Module.load (module.js:554:32)
        at tryModuleLoad (module.js:497:12)
        at Function.Module._load (module.js:489:3)
        at Module.require (module.js:579:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (/opt/app/node_modules/sharp/lib/index.js:3:15)
        at Module._compile (module.js:635:30)
    2019-02-11T15:41:06.942Z [1502] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    io: 2 emit [ 'disconnecting', 'transport error' ]
    io: 2 emit [ 'disconnect', 'transport error' ]
    io: 2 emit [ 'disconnecting', 'transport error' ]
    io: 2 emit [ 'disconnect', 'transport error' ]
    2019-02-11T15:41:06.949Z [1502] - info: [app] Web server closed to connections.
    2019-02-11T15:41:06.952Z [1502] - info: [app] Database connection closed.
    2019-02-11T15:41:06.952Z [1502] - info: [app] Shutdown complete.
    [cluster] Child Process (1502) has exited (code: 1, signal: null)
    [cluster] Spinning up another process...
    
    

    Can you help me plz?


  • Global Moderator

    @Alvaro5 what have you tried?

    What version of nodebb, nodejs, npm, database?



  • I have tried to upload image in a post or creating a topi, both with same error.
    I tried to upload a .zip file and it was fine, no errors.

    My versions are:
    nodebb: 1.10.2
    node: 8.9.1
    npm: 5.5.1
    database: mongodb

    The project is in Openshift environment.


  • Global Moderator

    Have you tried upgrading to Node 10?

    Have you tried any of the commands suggested previously in this topic?



  • I have tried the commands suggested previously but nothing works.

    I can`t upgrade node, is an empresarial Openshift and I don't have permisions to do that.


Log in to reply
 

Suggested Topics

  • 1
  • 1
  • 4
  • 5
  • 5
| |