ps73 / feathers-prisma

A Feathers service adapter for Prisma ORM.
MIT License
38 stars 3 forks source link

Connect to AWS Document DB #15

Closed robblovell closed 10 months ago

robblovell commented 1 year ago

Steps to reproduce

When using feathers-prisma in a AWS context with Document DB (Essentially MongoDB), the connection url needs to have ssl=true&ssl_ca_certs=rds-combined-ca-bundle.pem in it. The connection requires a pem file to work. But when using this url string, feathers-prisma gives the error:

ssl_ca_certs is an invalid option in database URL.

The full error is:

"Runtime.UnhandledPromiseRejection","errorMessage":"Error: The provided database string is invalid. MongoDB connection string error: ssl_ca_certs is an invalid option in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters."

The connection string is of the form: mongodb://user:pass@clusteName-cluseterARN.docdb.amazonaws.com:27017/dbname?ssl=true&ssl_ca_certs=certFileName.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false

This works in the context of other services we have using the node mongo client directly (not through Prisma).

Expected behavior

The adapter should connect to the database.

Actual behavior

The adapter doesn't connect.

System configuration

Deployed via serverless to aws lambda.

Module versions (especially the part that's not working):

"feathers-prisma": "^0.6.0"

NodeJS version:

Node 16

robblovell commented 1 year ago

This might be a problem with the Prisma client (PrismaClient).

ps73 commented 10 months ago

I think this is more like a prisma issue.

I will update prisma dependencies to v5 in the next few days. Maybe this fixes this.