Nodebb shuts down(502 bad gateway)

NodeBB Development
  • Hi again,

    I ran into some problem with NodeBB. I'm working with google apps script, taking data from a spreadsheet and inserting it into NodeBB via write api. First I insert a Category. then I insert another Category and update it's ParentID from the previously inserted Category, then I insert the topic and lastly I insert the post to the topic. After this procedure everything shuts down:

    • 29/8 15:00 [22748] - error: TypeError: data.content.rtrim is not a function(output.log),

    • (inside google script editor)

    And in another scenario where I already inserted Category and Category with updated ParentID everything works fine no errors no shutdown.

  • Can you provide a full server stack trace from the server?

  • Bad gateway might occur due to an incorrect setting in your Proxy.

    It is recommended by me to use Nginx as it is easy to setup and apparently automatically recovers after a bad gateway.

    What Operating System Are you using?

Suggested Topics

  • 0 Votes
    1 Posts

    Hi all,

    I'm trying to use the recently introduced WriteAPI to create topics and concurrently upload a file.
    I'm doing it via Python and I've already succeeded in create a simple topic without a file using something lilke

    payload = { "cid": cid, "title": title, "content": message } headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=json.dumps(payload))

    but when it's about files using

    payload = { "cid": backstage_cid, "title": backstage_title, "content": backstage_message } headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'multipart/form-data' } verifySSL = False print (payload) if (useFile): with open(backstage_file, 'rb') as f: response = requests.request("POST", url, headers=headers, data=payload, verify=verifySSL, files={backstage_file: f})

    it returns
    Error: Required parameters were missing from this API call: cid, title, content cause passing the parameters in a plain dictionary rather than a JSON object seems not doable.

    The switch from JSON to dictionary is needed otherwise I wouldn't have been able to pass a file together with such header

    headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'multipart/form-data' }

    Has anybody valuable suggestions here?

    Thanks in advance, Riccardo

  • 0 Votes
    2 Posts

    in the client, those values are stored in

    For your jQuery, you don't append a closing tag, it does that automatically. When you want to insert the element into the div, you need to use appendTo(). Also, unless your label has additional data, I recommend using html() instead of text().

    Here's a fiddle. I also added an ID to the new label so it isn't added more than once.

  • 0 Votes
    14 Posts

    Thank you.
    I did disable the option in the API-write module, and now it's working in a shell terminal when I send the above CURL command.
    But when I try to use CURL in HTTPS within my PHP program,
    I get this message (401) : A valid login session was not found. Please log in and try again.
    I don't understand why I get this message, because :

    I'm sending the Master token in the Header by calling the PHP function curl_setopt with the option CURLOPT_HTTPHEADER I try to send the credentials (login/password) by calling the PHP function curl_setopt with the option CURLOPT_USERPWD and login/password.
  • 0 Votes
    5 Posts

    Boy, that was quick! Thanks 🙂

  • 7 Votes
    25 Posts

    Didn't notice this - but I signed!