解析迁移错误到mLabs和Heroku [英] Parse migration Error to mLabs and Heroku

查看:181
本文介绍了解析迁移错误到mLabs和Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

至少一年前,我将解析数据库迁移到Mlabs。我一直在开发应用程序,并且解析仪表板表示我已成功迁移。 Mlab和Parse都收到了它们数据库的更新。



然而,在上一两周内,应用程序不再通过登录页面。没有代码可以调整它的服务器问题。这里是在Xcode日志中打印的错误:


UserInfo = {code = 100,originalError = Error Domain = NSURLErrorDomain Code = -1011 (null),temporary = 0,error =操作无法完成。 (NSURLErrorDomain错误-1011。),NSLocalizedDescription =操作无法完成。 (NSURLErrorDomain error -1011。)

现在我想我可能错过了迁移过程中的一个步骤,这非常合理,因为我是新手编码器。所以我按照这个



当我检查heroku日志时,它说:

  20T19:01:27.142050 + 00:00 app [web.1]:> parse-server-example@1.4.0 start / app 
2017-02-20T19:01:27.142052 + 00:00 app [web.1]:
2017-02-20T19:01:27.142051+ 00:00 app [web.1]:> node index.js
2017-02-20T19:01:28.597494 + 00:00 app [web.1]:
2017-02-20T19:01:28.597507 + 00:00 app [web.1 ]:/app/node_modules/parse-server/lib/requiredParameter.js:8
2017-02-20T19:01:28.597508 + 00:00 app [web.1]:throw errorMessage;
2017-02-20T19:01:28.597509 + 00:00 app [web.1]:^
2017-02-20T19:01:28.597515 + 00:00 app [web.1]:You必须提供一个serverURL!

***编辑它是serverURL没有在我的index.js中更新现在Heroku加载'I梦想成为一个网站'。 当日志显示您的 serverURL 缺失。在您的 index.js 中,您可以将其添加到您的构造函数中,然后在heroku上重新部署:

  var api = new ParseServer({
databaseURI:databaseUri ||'mongodb:// localhost:27017 / dev',
cloud:process.env.CLOUD_CODE_MAIN || __dirname +'/ cloud /main.js',
appId:process.env.APP_ID ||'xxxxxx',
masterKey:process.env.MASTER_KEY ||'zzzzz',
restAPIKey:'yyyyyy',
serverURL:process.env.SERVER_URL ||'http:// localhost:1337 / parse',
});


I migrated my parse db to Mlabs at least a year ago. I have been working on the app since and parse dashboard said I had migrated successfully. Mlab and Parse were both receiving updates to their databases.

However in the last week or two the app no longer goes past the login page. No code has beed adjusted its a server problem. Here is the error that prints in Xcode logs:

UserInfo={code=100, originalError=Error Domain=NSURLErrorDomain Code=-1011 "(null)", temporary=0, error=The operation couldn’t be completed. (NSURLErrorDomain error -1011.), NSLocalizedDescription=The operation couldn’t be completed. (NSURLErrorDomain error -1011.)

Now I figured maybe I missed a step in the migration process which is very plausible as I am a novice coder. So I followed this tutorial to Migrate Your Parse App To Parse Server With Heroku And mLab. I have followed each step and had success up until the last step: heroku open. It should open a web page that says I dream of being a web site but the page that opens is this:

When I check heroku logs it says:

2017-02-20T19:01:27.142050+00:00 app[web.1]: > parse-server-example@1.4.0 start /app
2017-02-20T19:01:27.142052+00:00 app[web.1]: 
2017-02-20T19:01:27.142051+00:00 app[web.1]: > node index.js
2017-02-20T19:01:28.597494+00:00 app[web.1]: 
2017-02-20T19:01:28.597507+00:00 app[web.1]: /app/node_modules/parse-server/lib/requiredParameter.js:8
2017-02-20T19:01:28.597508+00:00 app[web.1]:   throw errorMessage;
2017-02-20T19:01:28.597509+00:00 app[web.1]:   ^
2017-02-20T19:01:28.597515+00:00 app[web.1]: You must provide a serverURL!

***Edit it was the serverURL was not updated in my index.js Now Heroku loads 'I dream of being a website'.

解决方案

As the logs show your serverURL is missing. In your index.js you can add it to your constructor then redeploy on heroku:

var api = new ParseServer({
   databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
   cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
   appId: process.env.APP_ID || 'xxxxxx',
   masterKey: process.env.MASTER_KEY || 'zzzzz',
   restAPIKey: 'yyyyyy',
   serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',
});

这篇关于解析迁移错误到mLabs和Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆