Stuck in starting meteor - mongodb

This is really frustrating me. I have a DO VPS with ubuntu 14.04 (64) installed.
I installed VestaCP as control panel on that and have hosted some PHP based personal project.
I also installed meteor on it but never used, now when I am trying to create a project and run it ('meteor create rt' then 'cd rt' then 'meteor')
It is giving the following error :
[[[[[ /home/admin/code/rt ]]]]]
=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.
root#RD:/home/admin/code/rt#
Could anyone please help? Please ask me for more informations if required.
**** EDIT ****
I created a fresh DigitalOcean server and it is giving the same error on that. Some issue with Digital Ocean? File System of Digital Ocean? I am confused. I am trying it on different flavours of Linux and same result. All are fresh linux installations.

I finally got the solution. Posting it here for others.
This was the problem as a few environment variables which mongodb looks for while starting was not set
Set the variables LC_ALL and LANG and it works fine (mostly setting LC_ALL will do)
first, type locale command and see the output, you will see that it will say something about LC_ALL not set.
Now, add these two lines in /etc/environment and it worked.
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
This solution is for Ubuntu 12.04 +
Other variants may require similar work.

Unexpected mongo exit code 1 is still an uncaught exception as far as i think.
You can try by updating your c/c++ compilers uptodate. Have a look here.
It says :
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.6
sudo apt-get install g++-4.6
All the best!

So we have narrowed the issue down to meteor's mongo installation on your box (though I think we were pretty sure of this all along). Let's attempt to debug that a bit. The way I have done this in the past is to try to open meteor's mongo with the mongod provided by meteor. You will perform these procedures without running the meteor server. This should give you the warning that is causing Mongo to exit. First you need to find this. In my instance installed on Mint (which should be similar to Ubuntu) it is at:
~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod
You can look at that location on your Ubuntu box or you can run something like this to get the location:
find ~/.meteor/ -name mongod
Once you find the location then go to the directory of your meteor project you are attempting to run and in that directory you should find this location:
<your meteor project>/.meteor/local
cd into that directory and run the following command:
~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod --dbpath ./
From there you can analyze the output (or update the question so we can see the output) and this should show you the mongo error you are receiving on startup and allow you to fix it.

I've got the same issues trying to start a meteor app and exactly the mongodb server is being terminated in an unexpectly manner. Generally the virtual linux server from some dealers like the one you mentioned are coming without a swap partition (check in /etc/fstab file) so if you have not enough memory to allocate MongoDB server then meteor app can't be started. You can create a swap partition or instal swapspace
sudo apt-get install swapspace
After that I was able to start the meteor app... Just be patient as swap memory is not as faster as RAM.

Since due some "smart" StackExchange policy I cannot up-vote or comment to working solution...)
Quoted answer works also on Digital Ocean on CentOS 7 x64 vmlinuz-3.10.0-123.8.1.el7.x86_64
first, type locale command and see the output, you will see that it will say something about LC_ALL not set.
Now, add these two lines in /etc/environment and it worked.
I changed the locale setting to match my needs.

Fixed on my Debian 8 with the following bash command, (use sudo if needed)
localedef -i en_US -f UTF-8 en_US.UTF-8

Related

Tables could not be fetched - Error loading schema content

I open workbench and connect to a local database on XAMPP and when open the connection the schema show the error message:
"tables could not be fetched"
run this command on terminal
mysql_upgrade -u root -p
Run this command on terminal
sudo /opt/lampp/bin/mysql_upgrade
And as per the comment by #jonathan-delean , you might need to run this instead:
sudo /opt/lampp/bin/mysql_upgrade -u root -p
For XAMPP, this worked for me - run this on terminal:
sudo /Applications/XAMPP/xamppfiles/bin/mysql_upgrade
Disconnect then reconnect to your db.
First, locate the directory of which Xampp is installed at.
In linux you can just type this in a terminal:
whereis xampp
In my case (btw I use arch, jk) it was located at /opt/lampp/bin . If you're using windows, you may find it under a different location, like in C:\Program Files\xampp\bin
Next, locate the file mysql_upgrade and execute it as an administrator or a sudo.
If you're using Linux:
cd /opt/lampp/bin then sudo ./mysql_upgrade
According to MySQL documentation:
Each time you upgrade MySQL, you should execute mysql_upgrade, which
looks for incompatibilities with the upgraded MySQL server: It
upgrades the system tables in the mysql schema so that you can take
advantage of new privileges or capabilities that might have been
added. It upgrades the Performance Schema, INFORMATION_SCHEMA, and sys
schema. It examines user schemas.
So I believe mysql_upgrade should resolve the problem. It worked for me before.
More on mysql_upgrade here:
4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables
That's because the latest XAMPP use MariaDB and MYSQL Workbench is using MYSQL Database, so they are not fully compatible, raising that error for example.You can try to downgrade to some of the previous XAMPP versions.
For MacOS users:
sudo /Applications/XAMPP/bin/mysql_upgrade
I created another Connection in MySQL workbench, and the fetching problem for me was resloved.
I did have this problem today, the reason is:
Error Code: 1356 View 'test.xyz' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
After dropping those view (actually those views) the error was solved.
currently working with MySQL Workbench 8.0.28, and MySQL 8.0.28.
for macOS users run this on terminal:
sudo /Applications/XAMPP/bin/mysql_upgrade
this worked for me
See YouTube video: MySQL 8 - The message "Tables Could Not Be Fetched"
https://www.youtube.com/watch?v=phi6o8B7kKI
Either a table or view or function used in code has been dropped; hence the "...could not be fetched".
this works for me
sudo mysql_upgrade --force
As #Brittany Layne Rapheal says, with that command you can fix the issue, is also recommended to give execution privileges to that file:
So you should run first this command:
sudo chmod +x /Applications/XAMPP/xamppfiles/bin/mysql_upgrade
And then, this:
sudo /Applications/XAMPP/xamppfiles/bin/mysql_upgrade --force
--force is necessary because as the parameter says to force the update (Necessary)

How to run mongodb by making an account

I am very new to Mongodb. So, sorry if my question is preliminary. I need to start MongoDb by mongod --dbpath mongodb/data/db but I get the error that mongodb command is not found. I saw in many github codes and stackoverflow that others download and install mongodb but when I visit monodb website instead of download I saw the option "No download necessary Deploy a free cluster now" by making an account. I made an account and did not download it. How can I use that account and run mongodb in a way that I do not get this error?
I have found the solution and I put it heere for usage of others in the same case. I downloaeded mongodb from the main site.
I tried the tutorial for starting mongodb but I got errors that took time for me. I was in ubuntu 16. Finally I changed the ubuntu version and found these three commands in a youtube video which solved my problem.
sudo apt-get install mongodb
sudo apt-get update
sudo service mongodb start
Okay, here we go.
First things first, if you want to launch MongoDB on your local machine, try to download & install the latest community version from MongoDB site
As for the start by mongod --dbpath mongodb/data/db. Full launch & install guide you could found at Mongo Docs site.
But let's skip the docs part and take to the real case.
Before executing mongod use cd "path_to_mongod"
For example it will be "C:\Program Files\MongoDB\Server\bin" for Windows
You don't need to use --dbpath mongodb/data/db argument every time. Just use the config file.
Create DBA (root) account and make sure that your MongoDB use --auth, before making it available via http(s). Mongo doesn't have a password by default!

Debian 8.5 - Service : command not found

I've installed MongoDB following this (https://docs.mongodb.com/master/tutorial/install-mongodb-on-debian/?_ga=2.104926336.2025310627.1509020418-427799538.1509020418) but when trying to start MongoDB with : sudo service mongod start , i get a error indicating zsh: command not found: service
It would help to know your operating system. You may be on something
modern enough to support Systemd. In that case, the appropriate
command is something close to:
% sudo systemctl start mongodb
That works on an Arch Linux system. Yours might be called mongod or
something similar. You can just type the mongo part of it and hope
that Zsh will complete it appropriately.

How to start mongdb in Linux mint?

I would like to ask on how to start mongodb in linux mint. I tried sudo service mongod start but it shows the error mongod: unrecognized service. Why is this happen. When I run the sudo service in ubuntu Linux there is no problem like this. BUt why its not work in Linux mint? Is there a solution for this?
I just installed Mongo DB in LinuxMint Sarah (18) and for me, the following command worked:
sudo service mongodb start.
Checking that it works can be done either by executing 'top' command or checking the log file in mongodb folder (instructions in the following link ---> https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#run-mongodb-community-edition)
For stopping mongodb, the same command but typing stop 'sudo service mongodb stop'
In the previous link, both commands are included but without the 'b', maybe they just made a typing mistake :)

MongoDB not using /etc/mongodb.conf after I changed dbpath

Ever since I changed the dbpath in /etc/mongodb.conf, MongoDB has not been starting automatically, nor using the new dbpath. Prior to the change, MongoDB would be running when the computer started and I was able to simply run the command mongo to get into the console or start my Ruby on Rails server with no issues.
After I made the modification (in order to switch to a new drive with more space), the only way I can get everything to work is by manually running the command mongod --config /etc/mongodb.conf. If I don't run that, it doesn't seem like the service is running and running without the --config option give me the following error: ERROR: dbpath (/data/db/) does not exist. even though the config file says nothing about data/db.
Some other notes:
In addition to changing /etc/mongodb.conf, I moved all files out of /var/lib/mongodb and into /home/nick/appdev/mongodb.
I changed the owner and group from root to nick. Tried changing it back, but it didn't seem to fix anything.
I'm running Ubuntu 12.10 Beta 1 and Mongo 2.2.0 with Ruby on Rails 3.2.8
A late follow up on the above question...
I had a similar issue after moving the db to an ebs on ec2.
It turns out that just running mongod still directs the dbpath to /data/db/ (which exists).
The /etc/mongodb.conf is completely ignored unless specifically directed to.
I manage to work around this by using the directive --config or just the --dbpath(both work)
But was left wondering where does mongod takes it defaults from...?!
I was unable to locate and override these defaults anywhere.
Anyone ?
Note:
I am really annoyed by this behaviour of mongod...This is just bad design,and bad documentation.
It turns out that I needed to set the owner and group to mongodb. When I transferred the files to the new directory, I had set the owner and group to my user account nick and also tried root, neither of which worked.
To do so, here are the following commands:
sudo chown mongodb /home/nick/appdev/mongodb -R
sudo chgrp mongodb /home/nick/appdev/mongodb -R
To confirm that it worked, you can check the file permissions with:
ls -l /home/nick/appdev/mongodb
After checking all permission in the data, journal and log folders as suggested, my problem was solved by giving permission to a lock file in the /tmp folder
sudo chown mongod:mongod mongodb-27017.sock
I was running it as a AWS Amazon Linux instance. I figured that out by executing as the mongod user as below, and then, researching the error code. It might be useful for other troubleshooting.
sudo -S -u mongod mongod -f /etc/mongod.conf
MongoDB 1.6 is very old and the latest production version is 2.2, which contains a large amount of bug fixes and enhancements since 1.6.
Am I correct that you haven't installed 1.6 via a package manager such as yum or aptitude? I don't believe there are packages for 1.6 at present afaik. Therefore, mongod is behaving correctly as you have not started MongoDB with a control script.
Please see this link on configuration file options.