Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying projects with long hostnames fails [2 different bugs] #1208

Closed
chrisguilbeau opened this issue Jul 6, 2013 · 18 comments
Closed

Deploying projects with long hostnames fails [2 different bugs] #1208

chrisguilbeau opened this issue Jul 6, 2013 · 18 comments

Comments

@chrisguilbeau
Copy link

I have an app that's been deployed before. I made some changes to it and when attempting to redeploy got:

Now serving at hox-money.meteor.com

However when going to the site, I got "this site is down"

I attempted to delete the app and got:

Error deleting application: Unable to delete application

After trying to delete again, I got:

Error deleting application: Application does not exist

When going to the site it says, There is no site deployed at this address. Great!

When trying to deploy again, I get:

Error deploying application: Error creating application.

This happens even when I try to deploy to another site like hox-money2.meteor.com

The app runs fine locally and I'm wondering if there is anything else I can try?

@gihrig
Copy link

gihrig commented Jul 6, 2013

+1 at http://leaderboard.arkadias.meteor.com/ As the name implies this is a minimally modified leader board demo.

First noticed site was down about Jul 5 11pm PDT, still down at Jul 6 11:30 am.

Are the meteor.com dev hosts down?

@gihrig
Copy link

gihrig commented Jul 6, 2013

Try meteor logs {FQDN to hosted app}

For me, "meteor logs leaderboard.arkadias.meteor.com" returned a log contaning among others:

[Sat Jul 06 2013 18:43:39 GMT+0000 (UTC)] ERROR Application crashed with code: 1

dev:leaderboard glen$ meteor reset help
meteor reset only affects the locally stored database.

To reset a deployed application use
meteor deploy --delete appname
followed by
meteor deploy appname

However:

dev:leaderboard glen$ meteor deploy --delete leaderboard.arkadias.meteor.com
Error deleting application: Unable to delete application

Yep, Meteor is having issues...

@n1mmy
Copy link
Contributor

n1mmy commented Jul 6, 2013

I think I've figured it out and fixed it. Try now.

@ghost
Copy link

ghost commented Jul 6, 2013

I just went through this stuff. Here's what I've observed:

If you want to deploy locally:

  1. meteor

If you want to deploy on meteor.com:

  1. meteor deploy [appname].meteor.com

If you want to reset and deploy locally:

  1. meteor reset
  2. meteor

If you want to reset on meteor.com and deploy on meteor.com:

  1. Make sure the app is not running on [appname].meteor.com (e.g. close all tabs in which it's running)
  2. meteor deploy [appname].meteor.com --delete
  3. meteor reset
  4. meteor
  5. meteor deploy [appname].meteor.com

If you want to reset everywhere and re-deploy everywhere:

  1. Make sure the app is not running locally (e.g. ctrl + c in terminal)
  2. Make sure the app is not running on [appname].meteor.com (e.g. close all tabs in which it's running)
  3. meteor reset
  4. meteor deploy [appname].meteor.com --delete
  5. meteor // you must restart your app again locally before redeploying if you need to bootstrap your db
  6. meteor deploy [appname].meteor.com

Why all this trouble?
Essentially, you just need to ensure that whichever deployment you're dealing with (e.g. [appname].meteor.com or localhost:3000) has access to valid data in the db in order to necessarily implement the application. So, if you have reset the app locally, and the app requires some bootstrapped data for it to run, you need to first ensure that you run it locally once before trying to deploy remotely, so that the bootstrapped data can initialize.

@gihrig
Copy link

gihrig commented Jul 6, 2013

Working now, thanks.

@n1mmy
Copy link
Contributor

n1mmy commented Jul 6, 2013

Looks like one of our deployment processes was leaking mongodb connections, and the mongo server hit its hardcoded 20k connection limit. I restarted the deploy process so we've got lots of free connection slots now, and am looking to track down the leak.

Thanks for the report, and sorry for the inconvenience!

@n1mmy n1mmy closed this as completed Jul 6, 2013
@MaximDubrovin
Copy link
Contributor

I've trying to deploy app to meteor server for a month. Started from 0.8 and still can't on 0.8.1.2. Tried to reset everything like in comment above, but without success. I thought something with my app. But earlier today I successfully deployed another old 0.6 app. So I don't have any suggestions why I get «This site is down. Try again later.»

@dcsan
Copy link

dcsan commented May 15, 2014

@MaximDubrovin without any info on the repo, its going to be hard for anyone to help you.

@glasser
Copy link
Contributor

glasser commented May 24, 2014

Sounds like your app is crashing. Try running meteor logs YOURSITENAME

@MaximDubrovin
Copy link
Contributor

@glasser Thank you.

The problem was:

On local server I loaded config for AWS SDK without a problem from local path:

AWS.config.loadFromPath('local/file/path/aws-config.json');

But obviously it breaks server when app is deployed.

The solution:

Now I put config to packages/packageName/private/aws-config.json

Added this to package.js:

api.add_files('private/aws-config.json', 'server', {isAsset: true});

And I get this config from my package code with Assests API:

var AWSConfig = JSON.parse(Assets.getText('private/aws-config.json'));
AWS.config.update(AWSConfig);

Now it works.

The question:

Is it safe approach to store and use private config files?

@jbruni
Copy link
Contributor

jbruni commented May 26, 2014

BTW, I've recently failed to deploy an app, getting the "This site is down. Try again later." message. I waited, tried again, also the same error.

This app was none other than the "leaderboard" example. (I just wanted to create my Meteor Developer account.)

So, the name/subdomain for my app was something like "leaderboard-only-to-create-developer-account". It was quite long.

I shortened the name/subdomain of the app, and it worked.

@glasser
Copy link
Contributor

glasser commented Jun 2, 2014

@jbruni Did you try checking with meteor logs? That error message generally means the app is crashing or not responding.

@MaximDubrovin That sort of question is best for meteor-talk or stack overflow, not our bug tracker.

@jbruni
Copy link
Contributor

jbruni commented Jun 3, 2014

@glasser It was a fresh "leaderboard" app, unchanged from "meteor create --example leaderboard". I tried the deploy with the very long subdomain name several times during the day - all failed. I tried a smaller name, and it just worked, at first try. I haven't touched any code. Just wanted my Meteor developer account created to deploy a package at Atmosphere.

@glasser
Copy link
Contributor

glasser commented Jun 3, 2014

@jbruni For the third time: What happened when you ran meteor logs some-long-name-whatever? That is what explains why your app is crashing.

@jbruni
Copy link
Contributor

jbruni commented Jun 4, 2014

@glasser - The environment where it all happened was kind of "temporary": it has already gone. So, unfortunately, I can't obtain anything from meteor logs. I don't even remember what exactly the long-name was. There is no "bash history" available to get that long-name.

Anyway, just confirming: I only did a meteor create --example leaderboard. Next, I tried meteor deploy very-long-name.meteor.com and it returned "This site is down. Try again later." - and insisted on this behaviour several times throughout the day. Finally, I tried meteor deploy shorter-name.meteor.com and it worked. It strongly seemed there was a length limit for the subdomain/app name. But according to this thread, it seems the error message is misleading (it does not mean "meteor.com is down"; it means "your app is crashing"!?) I wonder why a fresh and unchanged "leaderboard" would crash? And why it has been successfully deployed only by trying a different (and shorter) app/subdomain name? And, please, consider making the error message less misleading and more meaningful...

@glasser
Copy link
Contributor

glasser commented Jun 4, 2014

The error was accurate: your site (very-long-name.meteor.com) was down.

I don't know why a site whose name you haven't told me was down. I realize that you have one guess, about name length, and that could be correct. But without actually telling me the name of the site so we can look at the logs, there is no way to debug this issue.

If you see this error again, you should take my advice and look at the logs.

If you don't ever see this error again, then great! There's no problem!

But I've answered 4 times now the question of "how do I learn more about why my app is down"; this thread is no longer productive.

@jbruni
Copy link
Contributor

jbruni commented Jun 4, 2014

Alright. I apologize.

I just found that the error is easily reproducible:

I've created a basic/free Nitrous.io box. Selected "Node.js", and installed Meteor using the "Autoparts" menu. I've also created a free disposable e-mail address at http://10minutemail.com/

What happened next has been fully copy/pasted in a gist here. The most important pieces are highlighted below.

With a "extra very long" name (another error message):

$ meteor deploy trying-to-deploy-leaderboard-app-only-to-create-meteor-developer-account.meteor.com                                                                                           

Sorry, Meteor does not yet support specific path URLs, such as                                                                                                                                                                                 
http://www.example.com/blog .  Please specify the root of a domain.                                                                                                                                                                            

$ meteor logs trying-to-deploy-leaderboard-app-only-to-create-meteor-developer-account.meteor.com                                                                                             

Sorry, Meteor does not yet support specific path URLs, such as                                                                                                                                                                                 
http://www.example.com/blog .  Please specify the root of a domain.

Now, with a "very long" name (my original issue):

$ meteor deploy deploy-leaderboard-app-only-to-create-meteor-developer-account.meteor.com                                                                                                     

Deploying to deploy-leaderboard-app-only-to-create-meteor-developer-account.meteor.com. Bundling...                                                                                                                                            
Uploading...                                                                                                                                                                                                                                   

Error deploying application: Service temporarily unavailable. Please try again later.                                                                                                                                                          

$ meteor logs deploy-leaderboard-app-only-to-create-meteor-developer-account.meteor.com                                                                                                       
Couldn't view logs: Site does not exist

And finally with a "moderately long" name (it works):

$ meteor deploy app-only-to-create-meteor-developer-account.meteor.com                                                                                                                        

Deploying to app-only-to-create-meteor-developer-account.meteor.com. Bundling...                                                                                                                                                               
Uploading...                                                                                                                                                                                                                                   
Now serving at app-only-to-create-meteor-developer-account.meteor.com                                                                                                                                                                          

You should set a password on your Meteor developer account. It takes                                                                                                                                                                           
about a minute at: https://www.meteor.com/setPassword?6eJtu29xhd                                                                                                                                                                               

$ meteor logs app-only-to-create-meteor-developer-account.meteor.com                                                                                                                          

[Wed Jun 04 2014 21:46:51 GMT+0000 (UTC)] INFO STATUS null -> starting                                                                                                                                                                         
[Wed Jun 04 2014 21:46:51 GMT+0000 (UTC)] NOTICE Starting application on port 13612                                                                                                                                                            
[Wed Jun 04 2014 21:46:51 GMT+0000 (UTC)] INFO STATUS starting -> running                                                                                                                                                                      
[Wed Jun 04 2014 21:55:19 GMT+0000 (UTC)] INFO HIT /_GALAXY_ 54.232.99.166                                                                                                                                                                     

You should set a password on your Meteor developer account. It takes                                                                                                                                                                           
about a minute at: https://www.meteor.com/setPassword?6eJtu29xhd                                                                                                                                                                               

As we can see meteor logs returns "Couldn't view logs: Site does not exist" for the "Error deploying application: Service temporarily unavailable. Please try again later." generated by long subdomain name.

Now, we've learned it is easy to reproduce it. (I've created a Nitrous.io fresh box, but my original experience was from my own personal laptop.)

@glasser
Copy link
Contributor

glasser commented Jun 5, 2014

Thank you for the specific bug report which provides enough information to actually debug the issues.

There appear to be two separate issues here:

(1) Domain names may only have segments of length up to 63 (see eg http://en.wikipedia.org/wiki/Domain_name#Domain_name_syntax). The URL parser code we use in the meteor tool client-side knows this, but our error handling code prints the wrong error message when rejecting it. This should be fixed by improving the client-side error message (and a PR could be issued for that).

(2) Mongo database names can only be 63 characters long, and the logic we use internally inside the meteor deploy server to generate mongo database names means that the total hostname can only be 63 characters long. This needs to be fixed internally at MDG.

@glasser glasser reopened this Jun 5, 2014
@glasser glasser changed the title Can not deploy project Deploying projects with long hostnames fails [2 different bugs] Jun 5, 2014
@glasser glasser closed this as completed Jun 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants