Prisma provider different in vercel than in code - prisma

In a previous push I've changed the provider from postgres to sqlite and it seems it is stucked and I can not change it back. In the vercel console I get the following error:
ERROR PrismaClientInitializationError: error: Error validating datasource `db`: the URL must start with the protocol `file:`.
--> schema.prisma:10
|
9 | provider = "sqlite"
10 | url = env("DATABASE_URL")
|
Validation Error Count: 1
Meanwhile in github you can see the code is the following:
datasource db {
provider = "postgres"
url = env("DATABASE_URL")
}
What is going on and how can I solve this?
Thanks

Related

Unable to connect to OrientDB - "Error in database URL: the engine was not specified"

Trying to connect to a new OrientDB (v3.2.15) database in Docker:
connect env remote:localhost root root;
create database apples plocal;
But am getting:
Error: com.orientechnologies.orient.core.exception.OConfigurationException: Error in database URL: the engine was not specified. Syntax is: <engine>:<db-type>:<db-name>[?<db-param>=<db-value>[&]]*. URL was: apples
Looking at the source code I can see : is required, or it'll through an exception - but the documentation says the opposite and my commands look correct.
Any ideas what I'm doing wrong, please?

Prisma: Error validating datasource `db`: the URL must start with the protocol `postgresql://` or `postgres://`

I am trying to deploy my NestJS application with prisma in production. But when launching my server, I have this error:
nestjs | PrismaClientInitializationError: error: Error validating datasource `db`: the URL must start with the protocol `postgresql://` or `postgres://`.
nestjs | --> schema.prisma:11
nestjs | |
nestjs | 10 | provider = "postgresql"
nestjs | 11 | url = env("DATABASE_URL")
nestjs | |
nestjs |
nestjs | Validation Error Count: 1
nestjs | at Object.loadEngine (/app/node_modules/#prisma/client/runtime/index.js:35591:19)
nestjs | at async Object.instantiateLibrary (/app/node_modules/#prisma/client/runtime/index.js:35520:5)
nestjs | at async Object.start (/app/node_modules/#prisma/client/runtime/index.js:35670:5)
nestjs | at async Proxy.onModuleInit (/app/dist/prisma.service.js:14:9)
nestjs | at async Promise.all (index 0)
nestjs | at async callModuleInitHook (/app/node_modules/#nestjs/core/hooks/on-module-init.hook.js:43:5)
nestjs | at async NestApplication.callInitHook (/app/node_modules/#nestjs/core/nest-application-context.js:178:13)
nestjs | at async NestApplication.init (/app/node_modules/#nestjs/core/nest-application.js:96:9)
nestjs | at async NestApplication.listen (/app/node_modules/#nestjs/core/nest-application.js:155:33)
nestjs | at async bootstrap (/app/dist/main.js:8:5) {
nestjs | clientVersion: '3.11.1',
nestjs | errorCode: 'P1012'
nestjs | }
My docker-compose.yml :
version: "3.2"
services:
nestjs:
container_name: nestjs
build:
context: ./apps/nestjs
dockerfile: Dockerfile.prod
env_file:
- ./apps/nestjs/.env
My .env :
DATABASE_URL="postgres://myUser:myPassword#myHost:myPort/myDB?sslmode=require"
What I tried to do :
Check that my .env was taken into account. When I go into the container, my environment variable exists
Try replacing postgres to postgresql
Any ideas?
Thanks you!
Problem solved.
I didn't have to surround the URL with " in my .env..
You didn't have to put " around your URL but you may need it and it should have worked.
In fact, it is an issue on old docker-compose version. Upgrade it and welcome " back !
I had the same problem,
Check your .env file if the URI is good
Check the provider from your schema.prisma
try to remove your node_modules and reinstall them.
That should do it๐Ÿ˜‰

VOMongoRepository fails to connect to MongoDB replicaset with user credentials (Pharo/Voyage)

I am trying to save a root Object (MyDocument) into a mongoDB with authentication enabled and a ReplicaSet consisting of 3 Nodes (as inserted into mongoUrls)
With this call:
(VOMongoRepository
mongoUrls: {'127.0.0.1:27017' . '127.0.0.1:27018' . '127.0.0.1:27019'}
database: 'myDB'
username: 'myUser'
password: 'myPass') enableReplication
I receive a VOMongoConnectionError without any deeper information.
Trying the same with this:
VOMongoRepository
mongoUrls: {'myUser:myPass#127.0.0.1:27017/?replicaSet=myRepl' }
database: 'myDB'
I then receive a VOMongoError "not authorized for Query on myDB.MyDocument"
The credentials are double checked with mongo client and Compass, also the read/write permissions (actually the role is dbOwner).
Interestingly my testDocumentLifeCycle is able to create the object and to send a message to save, that returns without signaling an error, although it does not create the document in MongoDB. But the selectOne: is then returning the VOMongoError:
| doc |
MyDocument new
identity: 'me#there.com';
save.
user := MyDocument selectOne: [ :each | each identity = 'me#there.com'].
Just to mention: the above test for MyDocument class did work with a standalone mongod without authentication enabled. The only thing changed is the repository.
So what am I doing wrong?
Actually there is a bug in the replicaSet part of VoyageMongo. It is not using the credentials provided. It has been posted at https://github.com/pharo-nosql/voyage/issues/104

"Internal server error" when migrating Parse to Heroku/AWS

I am evacuating the sinking Parse ship.
Migrated data to MongoDB
Tested connection with MongoDB while using api.parse.com
Hosted Parse server on Heroku \ AWS both
Tested the servers by going to their URL and seeing 'I dream of being web site"
Updated the appid, master key, and mongo uri for AWS and Heroku servers
In my app delegate when I use,
let config = ParseClientConfiguration(block:{ (ParseMutableClientConfiguration) -> Void in
ParseMutableClientConfiguration.applicationId = "APPID"
ParseMutableClientConfiguration.clientKey = "myClientKey"
ParseMutableClientConfiguration.server = "my AWS or Heroku server"
})
Parse.initializeWithConfiguration(config)
And I try to connect to update the MongoDB database, I get the following error,
[Error]: {"code":1,"message":"Internal server error."} (Code: 1, Version: 1.12.0)
Code=3840 "JSON text did not start with array or object and option to allow fragments not set."
Any help appreciated, thank you
Solved the issue, it was a silly mistake, the problem was that I had an #symbol in the password and I had not url-encoded it. When I escaped the symbol and restarted the server it started working.

Grails - Heroku not using the database defined in DataSource.groovy

I have just deployed my Grails app on to Heroku by following docs.. https://devcenter.heroku.com/articles/getting-started-with-grails#prerequisites
Before deploying I created a Dev Database and inserted the URL details into the production section of DataSource.groovy
production {
dataSource {
dbCreate = "update"
//url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
//url = "jdbc:postgresql://localhost:5432/myapp"
uri = new URI(System.env.DATABASE_URL?:"postgres://myuser:mypassword#someAWSmachine:5432/myapp")
url = "jdbc:postgresql://" + uri.host + ":" + uri.port + uri.path
username = uri.userInfo.split(":")[0]
password = uri.userInfo.split(":")[1]
however when I deloy out my application, it created another dev database and set this URL information of this new database into the settings under
Settings -> Config Variables -> DATABASE_URL
somehow my app runs and is using this newly created database and it's settings, my question is HOW? Why would my app not be failing to run, that fact I have a different database URL configured in my DataSource.groovy?
Woops... I didn't quite digest this line the first time I read it
uri = new URI(System.env.DATABASE_URL?:"postgres://myuser:mypassword#someAWSmachine:5432/myapp")
Note the System.env.DATABASE_URL? ternary operator.
I'll leave this question here for others