Error while using mongoose.I am not able to run my code and i have no idea how to get mongod services running - node.js

enter image description here
I am repeatedly getting this error while running my code.I googled it and it had something to do with mongod services not running but i dont know how to get the services started.

Your MongoDB database is most likely not running, from the path mentioned in your error, I am assuming you are running on Windows, I suggest you follow this guide: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#create-database-directory
You are going to have to create the data directories then start the database through your terminal.

Related

Unable to start mongodb from vscode terminal

I'm learning nodeJS and started it up fine yesterday, yet today when I tried to do it, it just reports the following error:
Unable to create/open the lock file: "C:\Users\User\Documents\MongoDB\bin\mongod.exe\mongod.lock" (The system cannot find the path specified.)
Ensure the user executing mongod is the owner of the lock file and has the appropriate permissions. Also make sure that another mongod instance is not already running..."
After reporting the error it just shuts down. I installed it not via the msi file, but by extracting the zip archive.
The mongodb data folder is empty for some reason, and no service of mongodb is running in windows services. My account is the administrator too.
clarification sought, Is your mongo DB instance setup correctly.
I mean are you able to run command mongo from command prompt. Please give some details if you are able to run a query on mongo standalone host.
note, you need to have data and log directory before you can run mongodb services.

Trivial Node.js via Passenger on DreamHost - Permission Denied

I tried setting up a do-nothing Node app, and it failed.
I developed some Node.js code offline in containers. I now want to try deploying it on DreamHost. I am doing it incrementally, adding features one by one. Starting with “Hello World” and going from there.
I set up a new subdomain and enabled Passenger. I was able to serve up an index.html file. I followed https://help.dreamhost.com/hc/en-us/articles/360029083351-Installing-a-custom-version-of-NVM-and-Node-js and installed Node and nvm (using the versions recommended in that artcle). I then installed a few packages I plan to use (most notably Express, the rest won’t come into play until later).
With just a Hello World app, that failed. The error message is below. But, I checked all the relevant files and they all have global read and execute permissions. I’m wondering if it is something else. I tried multiple Hello World examples for app.js, copied directly from different tutorials, none of which worked (but they do work locally). My more complex code also does not work, but that is the next step.
What am I missing? I followed the directions exactly. What other landmines do I have to look forward to? I really don’t want to spend time wrestling with infrastructure, I want it to “just work”, ideally.
An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger. Please read this article for more information about this problem.
Raw process output:
*** ERROR ***: Cannot execute /home/<user name>/.nvm/versions/node/v12.16.3: Permission denied (13)
Unclear what solved the issue.
Ran through changing the permissions on the files, as would seem obvious. Changed '/home/<user name>/.nvm/versions/node/v12.16.3' to '/home/<user name>/.nvm/versions/node/v12.16.3/bin/node' in the .htaccess file. Neither of those seemed to solve it.
Repeated the process again later. Followed it by `touch <webapp directory>/tmp/restart.txt' and it started working. I had been editing files in the web app's directory, so it isn't clear what touching that file did.

Need Help in Configuring Report Scheduler JasperServer

I have JasperServer Community Edition 5.5.0a installed in my Linux server. It is working fine. So I now want to set up report scheduler to be able to have the report in the mail box daily, weekly or monthly. I followed the link here. So in file js.quartz.properties I have this:
quartz.delegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
quartz.tablePrefix=QRTZ_
quartz.extraSettings=
report.scheduler.mail.sender.host=mail.mydomain.com
report.scheduler.mail.sender.username=myname#mydomain.com
report.scheduler.mail.sender.password=mypassword
report.scheduler.mail.sender.from=myname#mydomain.com
report.scheduler.mail.sender.protocol=smtp
report.scheduler.mail.sender.port=xxx
report.scheduler.web.deployment.uri=http://xxxxxxxxxx:8080/jasperserver
So I need to restart the JasperServer. Please refer below my finding when I run command through terminal:
./ctlscript.sh stop and got warning postgresql could not be stopped
kill -9 postgresql so the postgresql is killed
./ctlscript.sh stop and got warning postgresql not running
./ctlscript.sh start and got warning postgresql could not be started
I am confused on several things. Does JasperServer requires Postgresql? I don't use Postgresql and till now I can still fetch my report through PHP code. But when I schedule built-in example of JasperServer report, still I don't receive the report in my mailbox. Can somebody help me on how to configure this?
Please refer the link from jasper community.
http://community.jaspersoft.com/wiki/configuring-report-scheduler

Cannot write logs

I created a new Centos 6.5 VM in Azure and had RethinkDB running within a few minutes, which is great! However, I've been in the "Data Explorer" web interface and playing with ReQL queries for a while and suddenly I got an issue: "Cannot write logs" "File cannot be written on server xxx" "Log file is inaccessible on server xxx". I'm relatively new to Linux and hoping someone has previously resolved this.
To my surprise, the only reference to this error on the web is an issue on the RethinkDB repo: https://github.com/rethinkdb/rethinkdb/issues/2488 which doesn't really provide a solution, as far as I can see.
Try
sudo chmod -R uog+rw /var/lib/rethinkdb/*
If it doesn't work, try to just start rethinkdb from the command line to see if you still have the same issue.

MongoDB out of the box: not authorized for insert (Windows 7)

I've been following along with the actual MongoDB docs here
as well as several tutorial articles that are getting me absolutely nowhere.
Running a 64bit windows OS (which is a work computer, and my particular windows login is not an administrator login.. so I make sure to open any exe files as administrator). I can't do anything in the terminal beyond "mongo" or "use [db name]".
I cannot save or add anything like db.testData.insert( j ). Even typing "show dbs", I get an error that says
listDatabases failed:{ "ok" :0, "errmsg" : "unauthorized" } at src/mongo/shell/mongo.js:46
With every example I've followed, I can never seem to be "authenticated" to get past point A. Please help me! I have no idea what I'm doing wrong at this point.
UPDATE:
Sorry for the confusion, everyone. The problem turned out to be that I had an old MongoDB service still running in the background that I needed to disable.
The service must have been turned on while I was testing out some node packages or something. Once I disabled the service, everything started working as expected.
So for those of you who are having trouble, make sure you open up services.msc and make sure nothing is running MongoDB
As there isn't a formal installer for Windows, I'd recommend you delete the data folder and restart. Out of the box, there is no security in MongoDb, so you've followed a step which later requires a password. Either retrace your steps, or start over.
You don't need to switch to the admin Database. I'd suggest you instead switch to a test database for example:
> use test
switched to db test
By default, without extra configuration, on Windows you can delete the contents of c:\data\db when MongoDb isn't running (but if you're using a configuration file that specifies the dbpath, delete the contents of that folder).
There are a number of tutorials with details of how to configure users/security with Mongodb that you may want to read after you've resolved this issue.
There's little reason to create users and administrative control with MongoDB until you gain some experience with the platform. In fact, I wouldn't recommend it at all. It just gets in the way as you're seeing for no real gain.

Resources