I am following the https://deepstream.io/tutorials/plugins/database/postgres/
I have create a testDB with owner and permission to user james
In the conf/config.yml, I have the following configuration
plugins:
storage:
name: postgres
options:
user: james
database: testDB
password: james
host: localhost
port: 5432 #postgres default post
schema: ds #schema defaults to ds. Will be created if it doesn't exist
max: 10 #concurrent connections
idleTimeoutMillis: 30000 #timeout after which connection will be cut
writeInterval: 200 #amout of milliseconds during which writes will be buffered
notifications:
CREATE_TABLE: true #Get notified when tables are created
DESTROY_TABLE: true #Get notified when tables are dropped
INSERT: true # Get notified when records are created
UPDATE: false # Get notified when records are updated
However, when I run deepstream start, I got the following error
CONFIG_TRANSFORM | Loaded content from /Users/james/Workspace/deepstream.io/conf/permissions.yml for fileLoad(permissions.yml)
CONFIG_ERROR | Error loading module, exiting
Could someone please tell me what I have missed. Thank you for your help.
regards,
Johan
finally, I solved the problem, the configuration is correct, just to make sure that the postgres database and the role is done properly. The role needs to have a password and also LOGIN. Also, I clone the codes from github, so I can see what the error is when npm start. This will shows you verbose error message. If no error shown, npm test, this will show you all the missing packages and try to npm install again
Related
I am trying to upload mongo db backup to google drive
I am installing following bundles dizda/cloud-backup-bundle and Happyr
/
GoogleSiteAuthenticatorBundle for adapters I am using cache/adapter-bundle
configuration:
dizda_cloud_backup:
output_file_prefix: '%dizda_hostname%'
timeout: 300
processor:
type: zip # Required: tar|zip|7z
options:
compression_ratio: 6
password: '%dizda_compressed_password%'
cloud_storages:
google_drive:
token_name: 'AIzaSyA4AE21Y-YqneV5f9POG7MPx4TF1LGmuO8' # Required
remote_path: ~ # Not required, default "/", but you can use path like "/Accounts/backups/"
databases:
mongodb:
all_databases: false # Only required when no database is set
database: '%database_name%'
db_host: '%mongodb_backup_host%'
db_port: '%mongodb_port%'
db_user: '%mongodb_user%'
db_password: '%mongodb_password%'
cache_adapter:
providers:
my_redis:
factory: 'cache.factory.redis'
happyr_google_site_authenticator:
cache_service: 'cache.provider.my_redis'
tokens:
google_drive:
client_id: '85418079755-28ncgsoo91p69bum6ulpt0mipfdocb07.apps.googleusercontent.com'
client_secret: 'qj0ipdwryCNpfbJQbd-mU2Mu'
redirect_url: 'http://localhost:8000/googledrive/'
scopes: ['https://www.googleapis.com/auth/drive']
when I use factory: 'cache.factory.mongodb' getting
You have requested a non-existent service "cache.factory.mongodb" this while running server and while running backup command getting
Something went terribly wrong. We could not create a backup. Read your log files to see what caused this error
I verified logs getting Command "--env=prod dizda:backup:start" exited with code "1" {"command":"--env=prod dizda:backup:start","code":1} []
I am not sure which adapter needs to use and what's going on here.
Can someone help me? Thanks in advance
New to graph databases and trying to learn a few platforms for my senior project. I'm working on ArangoDB and can't seem to import data correctly.
The manual said to run the arangoimp file to execute import commands, but every time I launch the arangoimp file, it asks for a password (which is blank) and then exits with the following...
/Applications/ArangoDB3-CLI.app/Contents/Resources/arangoimp ; exit;
Please specify a password:
Connected to ArangoDB 'http+tcp://127.0.0.1:8529',
version 3.3.15, database: '_system', username: 'root'
----------------------------------------
database: _system
collection:
create: no
source filename:
file type: json
threads: 2
connect timeout: 5
request timeout: 1200
----------------------------------------
2018-09-20T19:17:30Z [25483] FATAL Collection name is missing.
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
Total noob here, so help is GREATLY appreciated... Working on a mac...
arangoimp is a command line tool that needs a few arguments. E.g. the collection you want to fill and the source data.
So you should use something like:
arangoimp --file "mydatafile.json" --type json --collection "mycollection"
Read the arangoimp documentation for more detailed information about all options and access to remote databases.
In knex documentation of configuration of knexfile.js for PostgreSQL, they have a property called client, which looks this way:
...
client: 'pg'
...
However, going through some other projects that utilize PostgreSQL I noticed that they have a different value there, which looks this way:
...
client: 'postgresql'
...
Does this string correspond to the name of some sort of command line tool that is being used with the project or I misunderstand something?
Postgresql is based on a server-client model as described in 'Architectural Fundamentals'
psql is the standard cli client of postgres as mentioned here in the docs.
A client may as well be a GUI such as pg-admin, or a node-package such as 'pg' - here's a list.
The client parameter is required and determines which client adapter will be used with the library.
You should also read the docs of 'Server Setup and Operation'
To initialize the library you can do the following (in this case on localhost):
var knex = require('knex')({
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
database : 'myapp_test'
}
})
The standard user of the client deamon ist 'postgres' - which you can use of course, but its highly advisable to create a new user as stated in the docs and/or apply a password to the standard user 'postgres'.
On Debian stretch i.E.:
# su - postgres
$ psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'SecretPasswordHere';"
Make sure you delete the command line history so nobody can read out your pwd:
rm ~/.psql_history
Now you can add a new user (i.E. foobar) on the system and for postgres
# adduser foobar
and
# su - postgres
$ createuser --pwprompt --interactive foobar
Lets look at the following setup:
module.exports = {
development: {
client: 'xyz',
connection: { user: 'foobar', database: 'my_app' }
},
production: { client: 'abc', connection: process.env.DATABASE_URL }
};
This basically tells us the following:
In dev - use the client xyz to connect to postgresqls database my_app with the user foobar (in this case without pwd)
In prod - retrieve the globalenv the url of the db-server is set to and connect via the client abc
Here's an example how node's pg-client package opens a connection pool:
const pool = new Pool({
user: 'foobar',
host: 'someUrl',
database: 'someDataBaseName',
password: 'somePWD',
port: 5432,
})
If you could clarify or elaborate your setup or what you like to achieve a little more i could give you some more detailed info - but i hope that helped anyways..
first of all I'm a noob at Geddy so the answer might be something stupid I forgot, but I keep getting an error while using Geddy auth and MongoDB at the same time; Here's what I did:
geddy app myapp
Then I configured config/development.js to use MongoDB:
var config = {
detailedErrors: true
, debug: true
, hostname: null
, port: 4000
, model: {
defaultAdapter: 'mongo'
}
, db: {
mongo: {
dbname: 'myappdb'
}
}
, sessions: {
store: 'memory'
, key: 'sid'
, expiry: 14 * 24 * 60 * 60
}
};
module.exports = config;
Finally I installed geddy auth and launched the app:
geddy auth
geddy
When I navigate to localhost:4000/ everything seems to work fine at first, but if I refresh the page or try to create a new user, I get a beautiful Error: 500
Error: 500 Internal Server Error
Error: db object already connecting, open cannot be called multiple times
at Db.open (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/node_modules/mongodb/lib/mongodb/db.js:240:11)
at open (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:625:20)
at self.connection (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:618:9)
at connection (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:190:18)
at /usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:433:13
at cursor (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:158:9)
at self.toArray (/usr/lib/node_modules/geddy/node_modules/model/node_modules/mongodb-wrapper/lib/mongodb-wrapper.js:135:16)
at utils.mixin.load (/usr/lib/node_modules/geddy/node_modules/model/lib/adapters/mongo/index.js:194:14)
at Object.obj.all (/usr/lib/node_modules/geddy/node_modules/model/lib/index.js:501:25)
at Function.obj.first (/usr/lib/node_modules/geddy/node_modules/model/lib/index.js:459:18)
I tried to update geddy using npm and to reinstall the mongo-adapter package but nothing's changed, I'm starting to get really frustrated as I can't find a solution and know it's probably just something simple I'm missing out.
Any idea of what is wrong ?
Thanks in advance for the help !
I think that you don't have MongoDB running...
To run your Geddy App you need both things, mongodb and geddy server running.
First of all, start your mongo server:
$ mongod
And later launch geddy on your root app directory
$ geddy
Hope that helps
I've installed propel bundle for symfony2.
my database configuration is:
propel:
dbal:
driver: pgsql
user: postgres
password: postgres
dsn: pgsql:host=localhost;port=5432;dbname=test_database
options: {}
attributes: {}
When i wan to create this database from console (console propel: database:create) i have got strange error : Unable to open PDO connection [wrapped: SQLSTATE[08006] [7] FATAL: database "pgsql" does not exist.
i created pgsql database on my localhost and everything was good. Database "test_database" was succesfull created. Can somebody explain me why i got this previous error? On mysql i've created database without any problems.
This issue was a bug in the PropelBundle, it has been fixed by the following commit (even if the commit message is about MySQL, it fixes other RDBMS): https://github.com/propelorm/PropelBundle/commit/b4475d27fb1eb846d10cc2d2e2bd164f037508e3
I 've installed new PropelBundle via Composer and everything is ok now. I think maybe it was a problem with 1.0 bundle , now I have 1.1