parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Batch fails after updates

Open 3rand opened this issue 9 years ago • 2 comments

Issue Description

I am running a parse-server on top of express. Everything was working fine since december. Lately we updated to last version and noticed that batch requests are always failing:

{"readyState":4,"responseText":"{"code":107,"error":"cannot route batch path /classes/MyClass/a8M82Um3Mr"}","responseJSON":{"code":107,"error":"cannot route batch path /classes/MyClass/a8M82Um3Mr"},"status":400,"statusText":"Bad Request"}

Steps to reproduce

This is how I am making the request: $.ajax({ url : 'http://54.245.244.75:80/parse/batch', type:"post", dataType: 'json', contentType : 'application/json', headers : { 'X-Parse-Application-Id' : '####', 'X-Parse-REST-API-Key' : '####' }, data : postData, success : function(data) { console.log(JSON.stringify(data)); }, error : function(data) { console.log(JSON.stringify(data)); });

This is my server init: var api = new ParseServer({ databaseURI: "mongodb://###:###@127.0.0.1:27017/parsedb", cloud: "./cloud/main.js", appId: "####", masterKey: "####", fileKey: "####", serverURL: 'http://#####/parse'});

Expected Results

The code was running fine before. The batch jobs are all PUT requests, so classes should be updated.

Actual Outcome

Error 400 : Bad request

Environment Setup

  • Server

    • parse-server version : tried 2.3.2 and 2.3.5
    • Operating System: Ubuntu
    • Hardware: Virtual machine, enough resources
    • Localhost or remote server? AWS
  • Database

    • MongoDB version: 307
    • Storage engine: rocks
    • Hardware: same as server
    • Localhost or remote server? AWS

Logs/Trace

Error handling request: ParseError { code: 107, message: 'cannot route batch path /classes/MyClass/OCTsnNDF1i' }

3rand avatar Feb 22 '17 11:02 3rand

@3rand in my case failing batch request was caused by invalid parse-server config. publicServerURL didn't match serverURL (mount path was missing)

virtualtoy avatar Apr 04 '17 12:04 virtualtoy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 18 '18 12:09 stale[bot]