parse-server: Parse.Query not working on Heroku (No Such App error)
Environment Setup
- Used the ‘deploy to heroku’ button from the migration guide
Steps to reproduce
- Upload this cloudcode function and call it
Parse.Cloud.define('debuggingFn', function(request, response) {
var query = new Parse.Query("Speech");
query.equalTo("speechId", "s_1456277936842");
query.find({
success: function(results) {
console.log('SUCCESS', results)
response.success("Success", results);
},
error: function(a, b) {
// ERROR CAUGHT HERE: 'Heroku | No such app'
console.log('ERROR', a, b)
response.error("Error");
}
});
});
Logs/Trace
- I expect to get a result, instead I get a (from the parse server logs)
ParseError {
2016-04-24T04:39:20.444057+00:00 app[web.1]: code: 107,
2016-04-24T04:39:20.444079+00:00 app[web.1]: message: 'Received an error with invalid JSON from Parse: _<bunch of html>_ <h1><strong>Heroku | No such app</strong></h1>\n <div class=\'article\'>\n <p>There is no app configured at that hostname.<br/>Perhaps the app owner has renamed it, or you mistyped the URL. _<bunch of html>_
Queries from the client website to my parse server work fine. Only the cloud code queries fail.
I believe I’ve followed every step from the migration guide, but googling doesn’t return anyone else having this issue. So I guess I missed something?
This is the dependencies from my package.json file in the parse server project:
"dependencies": {
"express": "~4.11.x",
"kerberos": "~0.0.x",
"parse": "~1.8.0",
"parse-server": "~2.2.7",
"cors": "*"
},
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (1 by maintainers)
Make sure your parse-server is up to date and that you have serverUrl defined when starting it.
Hi @Jerland2, I’ve closed this task as my original issue got resolved. You may have better luck opening a new issue or asking on stackoverflow.
For your issue I don’t know what would be causing that. It doesn’t seem like a very useful error. The only thing that stands out is that
Parse.Cloud.useMasterKey();is deprecated and you should useuseMasterKey: trueinstead. Good luck!@aaronbannin Heroku did set the default initially, which I forgot to/didn’t realise to update when I changed the heroku app name. So if it is possible to do a check for that I think it would help.
I had the wrong mental modal about what parse server was doing. I didn’t think Parse.query would actually make a url request to itself (when in cloud code), I assumed it would just call a method directly. Which is why when I got the error back about URLs I assumed it was a different error that was getting masked as a bad url.
Googling the heroku error suggested incorrectly that the Heroku Domain was wrong, which is different to parse’s SERVER_URL config variable. This also added to my confusion.
Thanks again for your quick reply and helpful answers.
@That-David-Guy , my thinking is that the errors were not helpful in diagnosing the issue. In my case, Heroku set a default URL (it was something like “yourapp.com/parse”).
@bohemima Thanks! The serverUrl config set in the heroku app had a typo in it. I fixed that and it’s all working. Seems obvious now.
It all seems to be working now.