question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`InvalidDatasourceError` of Data Proxy Client outputs a code snippet

See original GitHub issue
C:\Users\Jan\Documents\throwaway\dataProxyTest>node script.js
C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:27
`)}`});let i={batch:e.map(o=>({query:o,variables:{}})),transaction:r},{batchResult:a}=await this.requestInternal(i,t,n);return a}async requestInternal(e,t,r){var n;await this.pushPromise;try{this.logEmitter.emit("info",{message:`Calling ${this.url("graphql")} (n=${r})`});let i=await Sr(this.url("graphql"),{method:"POST",headers:{...t,...this.headers},body:JSON.stringify(e)}),a=await Kr(i,this.clientVersion);if(a instanceof Yr)throw await this.uploadSchema(),new Wr({clientVersion:this.clientVersion,c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

InvalidDatasourceError: Datasource URL should use prisma:// protocol. If you are not using the Data Proxy, remove the `dataProxy` from the `previewFeatures` in your schema and ensure that `PRISMA_CLIENT_ENGINE_TYPE` environment variable is not set to `dataproxy`.    at Object.extractHostAndApiKey (C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:27:1513)    at new DataProxyEngine (C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:25:14740)    at t.getEngine (C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:104:3039)    at new PrismaClient (C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:104:2583)    at file:///C:/Users/Jan/Documents/throwaway/dataProxyTest/script.js:2:16    at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
    at async Loader.import (node:internal/modules/esm/loader:178:24)
    at async Object.loadESM (node:internal/process/esm_loader:68:5)
    at async handleMainPromise (node:internal/modules/run_main:63:12) {
  clientVersion: '3.14.0',
  cause: undefined,
  isRetryable: false,
  code: 'P5002'
}

This error output is unexpected.

Reproduction

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Jun 7, 2022

Now I can confirm this is fixed with 3.15.0:

PS C:\Users\Jan\Documents\throwaway\3150> node .\scripts.js
C:\Users\Jan\Documents\throwaway\3150\node_modules\@prisma\client\runtime\index.js:44543
      throw new InvalidDatasourceError("No valid API key found in the datasource URL", {
            ^

InvalidDatasourceError: No valid API key found in the datasource URL
    at DataProxyEngine.extractHostAndApiKey (C:\Users\Jan\Documents\throwaway\3150\node_modules\@prisma\client\runtime\index.js:44543:13)
    at new DataProxyEngine (C:\Users\Jan\Documents\throwaway\3150\node_modules\@prisma\client\runtime\index.js:44399:33)
    at PrismaClient.getEngine (C:\Users\Jan\Documents\throwaway\3150\node_modules\@prisma\client\runtime\index.js:49538:16)
    at new PrismaClient (C:\Users\Jan\Documents\throwaway\3150\node_modules\@prisma\client\runtime\index.js:49512:29)
    at file:///C:/Users/Jan/Documents/throwaway/3150/scripts.js:2:16
    at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
    at async Loader.import (node:internal/modules/esm/loader:178:24)
    at async Object.loadESM (node:internal/process/esm_loader:68:5)
    at async handleMainPromise (node:internal/modules/run_main:63:12) {
  clientVersion: '3.15.0',
  cause: undefined,
  isRetryable: false,
  code: 'P5002'
}
1reaction
millspcommented, Jun 1, 2022

Sorry, let me correct myself, I meant that I cannot reproduce this with the latest changes in the chore/data-proxy-ga-3 branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma 3.15.0 Release - GitClear
In this release, we're shipping a couple of improvements to Prisma Client for Data Proxy. The Prisma Data Proxy provides connection management ...
Read more >
InvalidDatasourceError: Datasource URL should use prisma ...
So I am using Prisma as an ORM on my project to communicate with the database that I set up with AWS. Not...
Read more >
Prisma on Twitter: " Using the Prisma Client and leveraging ...
Workers! Check out this neat code snippet on how it looks like to use Prisma Client inside of this environment More info here: ......
Read more >
Setting Up HTTP Proxies - CircleCI
Learn how to configure CircleCI server to use an HTTP proxy. ... SSH into the Services machine and run the following code snippet...
Read more >
@prisma/generator-helper: Versions | Openbase
prisma migrate dev previously returned a successful exit code (0) when prisma db seed ... InvalidDatasourceError of Data Proxy Client outputs a code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found