cannot upload pictures on newly installed nodebb

  • NodeBB

    You can with the setting Allow users to upload regular files

    upload-4c3fc98d-20a1-4d2d-a02e-20b2ff5c695d

    Not sure why it's not working for you. What is the browser console saying about that /api/post/upload call.


  • @baris said:

    Not sure why it's not working for you. What is the browser console saying about that /api/post/upload call.

    [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (upload, line 0)


  • If I try to attach it using the image icon on console I get the following:

    TypeError: Failed to decode param 'uploading%20100%'
    at decode_param (/nodebb/node_modules/express/lib/router/layer.js:147:15)
    at Layer.match (/nodebb/node_modules/express/lib/router/layer.js:119:11)
    at Function.match_layer (/nodebb/node_modules/express/lib/router/index.js:281:16)
    at next (/nodebb/node_modules/express/lib/router/index.js:182:10)
    at /nodebb/node_modules/express/lib/router/index.js:184:16
    at Function.match_layer (/nodebb/node_modules/express/lib/router/index.js:288:3)
    at next (/nodebb/node_modules/express/lib/router/index.js:182:10)
    at /nodebb/node_modules/express/lib/router/index.js:184:16
    at Function.match_layer (/nodebb/node_modules/express/lib/router/index.js:288:3)
    at next (/nodebb/node_modules/express/lib/router/index.js:182:10)

  • NodeBB

    What is the filename of the image?


  • @baris said:

    What is the filename of the image?

    images.jpeg and it's 7K large

  • NodeBB

    The dimensions of the image shouldn't matter its the filesize thats important. Can you send a copy of the image to [email protected] I will try uploading that.


  • I have sent you the file but I have tried with multiple files and sizes and formats and I got the same errors with each and every one of them.

  • NodeBB

    Yeah I tried uploading the file you sent me on my dev environment and it works fine.

    upload-0dfbb66b-d8d8-4e5f-b1d3-b9ccdb6a3853

    It has to be something with your setup that's causing the problem. Either the /uploads folder doesn't have the correct permissions or something else is wrong.


  • ok in config.son the config looks like this:

    "upload_path": "/public/uploads",
    

    the nodebb installation is on /nodebb and the public folder looks like this:

    [email protected]:/nodebb# ls -la public/
    total 44
    drwxr-xr-x  9 www-data www-data 4096 Aug  9 15:42 .
    drwxr-xr-x 11 www-data www-data 4096 Aug  9 15:44 ..
    -rw-r--r--  1 www-data www-data 1150 Jul 29 15:43 favicon.ico
    drwxr-xr-x  3 www-data www-data 4096 Jul 29 15:43 images
    drwxr-xr-x 34 www-data www-data 4096 Jul 29 15:43 language
    -rw-r--r--  1 www-data www-data 3151 Jul 29 15:43 logo.png
    drwxr-xr-x  2 www-data www-data 4096 Aug  9 15:41 sounds
    drwxr-xr-x  4 www-data www-data 4096 Aug  7 03:21 src
    drwxr-xr-x  7 www-data www-data 4096 Aug  9 15:42 templates
    drwxrwxrwx  2 www-data www-data 4096 Aug  7 09:25 uploads
    drwxr-xr-x 12 www-data www-data 4096 Jul 29 15:43 vendor
    
  • NodeBB

    I would suggest installing nodebb as a normal user and running it with that user as well.


  • Running it as root does not change a thing. It is running as root.


  • My other question is that the upload_path from the config file is showing the relative path or absolute path? If it is the absolute path shouldn't be /nodebb/public/uploads? and if it is showing the relative path shouldn't be 'public/uploads'?


  • @baris

    Can you please paste the part of your config.son related to file upload so that I can compare it with what I have?

  • NodeBB

    {
        "upload_path": "/public/uploads",
        "relative_path": ""
    }
    

  • @baris I have the same. I have no idea why this is not working even if all is installed and run using root.

  • GNU/Linux Admin

    Are you still getting this error?

    Do you have any custom plugins installed, and if you disable all of them, does image uploading work?


  • Yes I still getting that error. I have only a Facebook and twitter sso plugins and a malign plugin installed nothing else.


  • I have found out that I cannot upload because the API should be listening on port 3000 but the port 3000 is used by another node.js application. Is there any way to change the api listen port to something else?

    this was in the log of the nginx error log

          2014/08/27 13:13:20 [error] 31534#0: *1972 connect() failed (111: Connection refused) while connecting to upstream, client: 79.119.156.210, server: vpsie.247rack.net, request: "POST /api/post/upload HTTP/1.1", upstream: "http://127.0.0.1:3000/api/post/upload", host: "vpsie.247rack.net", referrer: "http://vpsie.247rack.net/forum/topic/1/testing/2"
    
  • GNU/Linux Admin

    NodeBB listens to whatever port number you set in the configuration file (config.json). What is port set to there?


  • This is not the node's listen port but it's internal API port which takes the images and places them in the proper place. My node is listening on the default port 4567.

Suggested Topics

  • 7
  • 7
  • 4
  • 11
  • 4
| |