I seem to be having trouble connecting to MongoHQ (via MongoSkin) on jitsu.
I can connect from localhost though, and all I'm doing is changing my env
var and jitsu deploying. It's just strange that it works locally but not
deployed. I had talked with someone on IRC but unfortunately I didn't find
a solution.
I did notice this, the first error, which is mine as well:
http://errors.jit.su/
Is Mongoskin having any issues like this?
I have also tried using other modules (node-mongo-native, etc), and
with the same results- I can connect locally to MongoHQ, but not on jitsu.
Thanks for any help or insights!
the following:
mongoose.connect('mongodb://username:password#subdomain.mongohq.com:port/collectionName');
works flawlessly both locally and on jitsu, at least for me.
thats the string that nodejitsu gave me when creating the db in their webinterface.
i never tried any other mongo orm so i cant help with any other method of getting a connection to mongo.
have fun
jascha
edit: using the latest versions of all scripts here
(package.json: "mongoose": "latest" and so on)
Related
I need some help. I created a CRUD with Flask, and I want to conect it with my MySQL in azure. I new using Flask, so I don't know how to do it. Somebody can help me?
Now, I tried to do this:
app.config['SQLALCHEMY_DATABASE_URI']'mysql://Myuser#Myuser:MyPasswrd#MyDataBase:3306/mySchema'
My localhost works, so, I tried to change the username,passwrd and database and thought that it would work. But it didn't. I can access my Mysql-azure via workbench btw.
Thank you for reading!
I tried it here, and I got an error, I'll put a photo here. idk if this errors is because I dont have a MySQL connection, or something (I was using but I removed to see if it would work). Here a print of my instance.py and the error Instance of server
It should work after installing mysql-connector.
pip install mysql-connector
change the SQLALCHEMY_DATABASE_URI in your python script to below and create your database.
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql+mysqlconnector://{username}:{password}#{server}/testdb".format(username, password, server)
let me know if you see any specific error
NOTE: This is mainly a question about the pg or Node-PostgreSQL module. It has details from Gatsby and Postgraphile, but I don't need expertise in all three, just pg.
I have a database that works great with a PostGraphile-using Express server. I can also acces it via node at the command line ...
const { Pool } = require("pg");
const pool = new Pool({ connectionString: myDbUrl });
pool.connect().then(() => console.log('connected'));
// logs 'connected' immediately
The exact same database also previously worked great with Gatsby/PostGraphile via the gatsby-source-pg plug-in ... but recently I changed dev machines, and when I try to build or run a dev server, Gatsby hangs on the "source and transform nodes" step. When I debug it, it's hanging on a call to pool.connect().
So I literally have two codebases both using PostGraphile, both with the same config, and one works and the other doesn't. Even stranger, if I edit the source code of the Gatsby plug-in in node_modules, to make it use the exact same code (which I can run at the command line successfully) ... it still hangs.
The only thing I can think of is that some other Gatsby plug-in is using up all the connections and not releasing them, but as far as I can tell (eg. by grep-ing through node_modules) no other plug-in even uses pg.
So really I have two questions:
A) Can anyone help me understand why connect would hang? Bonus points if you can help me understand why it would do so with a known-good config and only inside Gatsby (after some environmental factor changed)?
B) Can anyone help me fix it? If it might be some sort of "previous code forgot to release connections" issue, is there any way I can test for that? If I could just log new Pool().areYouBroken() somehow that would be amazingly useful.
Try:
npm install pg#latest
This is what got my pool/connection to start working as expected.
Annoying answer: because of a bug (thank you #charmander). For further details see: https://github.com/brianc/node-postgres/issues/2300
P.S. I never did find any sort of new Pool().areYouBroken() function.
I have a React app using Relay and a remote GraphQL server. When I start the webpack server, I have it fetch the latest schema and feed it into the babel-relay-plugin.
It works great....except when I make a schema change. It appears React or Relay or webpack or something is caching the schema, because I'll get a Schema validation error in the browser console when I run the app. However, when I run the query manually against the GraphQL server using GraphIQL, the query is successful. So it would have to be some sort of cache on the react, relay, webpack side I'm thinking?
Things I've tried:
List item
Restarting webpack server
Removing node_modules and npm install
I've even tried restarting my computer (that actually seemed to work, but may be coincidence)
Thanks in advance for your help.
Turns out, of course, it was human error. I had cacheDirectory as true in my babel-loader query. You can read about it on the babel-loader readme (just do a find on page for 'cacheDirectory') https://github.com/babel/babel-loader
Once I changed that to false, which is the default. The problem went away. Hope that helps others.
This happened to me when I switched to Webpack 2.
The solution in my case was to move the babelRelayPlugin to be the first plugin to execute in .babelrc.
I'm not exactly sure on the why though.
I have recently started working with MongoDB and had it working for a small web test with node JS However. I new my implementation wasn't following a decent MVC structure. I began searching and found this website and read through it. It's implementation look good as well as following a good MVS skeleton structure.
Express/NodeJS/MongoDB CRUD Skeleton
I got to the part where he says 'HOORAY! We've got a functioning web server that is talking to Mongo. Part 1 is accomplished." Unfortunately, I went the local host specified and it says the 'site cannot be reached'. I am still fairly new to NodeJs, Mongo and Express and cannot figure out why it is not working.
I am not sure if I have done a step wrong time and time again which I doubt or if there something is missing that is stopping me from having it working.
The part before it says:
Awesome. Now to test it's all working in the terminal type npm start and you shouldn't see any errors:
kcoleman-mbp:nodewebapp kcoleman$ npm start
> nodewebapp#0.0.1 start /Users/kcoleman/Documents/projects/nodewebapp
> node ./bin/www
That part I get the same outcome with:
nodewebApp and node./bin/www
The page says to navigate to 127.0.0.0:3000, but the localhost usualy defaults to 127.0.0.1. I didn't see any code in the page where he defines the port to 127.0.0.0.
So try connecting to 127.0.0.1:3000.
Coming to nodewebApp and node./bin/www, it could be because the command might be present in pacakge.json. If you delete the nodewebApp from package.json, you won't be seeing the same in the command.
I am deploying a meteor application to a digital ocean droplet with meteor upload. Everything goes well, the application gets deployed, database works, seeding of data works etc. But there is one problem i can't seem to be able to solve.
I use the meteor-uploads package (https://github.com/tomitrescak/meteor-uploads) for file uploads. Locally everything goes well, the file gets uploaded, finished callback gets called etc. But once I have deployed the application to the server it keeps giving me on of these errors, :
POST http://*ip*/upload net::ERR_CONNECTION_REFUSED
POST http://*ip*/upload net::ERR_EMPTY_RESPONSE
POST http://*ip*/upload net::ERR_CONNECTION_RESET
Any ideas are welcome, I have searched all over for a solution but none seems to fit my problem. I also installed to a fresh droplet but that didn't help. In none of my browsers (Mac Chrome, safari & firefox) does it work, on my phone (Android 5.0) I get the same errors. I am using the newest Meteor version 1.1.0.1
On local host you don't need to set the environmental variables, but the host services provides you should.
Check this tutorial to see how to put the environment variables.
Because the file-upload needs a startup-server-configuration, like this.
//file:/server/init.js
Meteor.startup(function () {
UploadServer.init({
tmpDir: process.env.PWD + '/.uploads/tmp',
uploadDir: process.env.PWD + '/.uploads/',
checkCreateDirectories: true //create the directories for you
})
});
But im not sure if putting this on a startup will work on digital ocean, like i say you you enter it, run printing and check if the /.uploads/ exists