prisma: Missing credentials in Postgres URL: Got invalid RPC response without .result property

Schema

datasource db {
  provider = "postgresql"
  url      = "postgresql://localhost:5432/bother?schema=public"
}

generator photonjs {
  provider = "photonjs"
}

model Post {
  id       String    @id @default(cuid())
  body     String
  comments Comment[]
  location Float[]
  rating   Int
  ratings  Rating[]
  user     User
  created  DateTime  @default(now())
}

model Rating {
  id        String   @id @default(cuid())
  direction Int
  post      Post
  user      User
  created   DateTime @default(now())
  updated   DateTime @default(now())
}

model Comment {
  id      String   @id @default(cuid())
  body    String
  post    Post
  user    User
  created DateTime @default(now())
}

model User {
  id            String   @id @default(cuid())
  notifications Boolean
  platform      String
  posts         Post[]
  push_token    String
  created       DateTime @default(now())
  updated       DateTime @default(now())
}

Versions

macOS 10.14.5 (18F132)
Prisma prisma2@2.0.0-preview-7, binary version: 33e5fc84b6bd61602f8d634beb558230ca3e3054
PostgreSQL psql (PostgreSQL) 11.4

@pantharshit00 I’m not using embeds or dashes in my schema name. VSCode Prisma extension clears my schema, too. Any help?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26 (11 by maintainers)

Most upvoted comments

Thanks, I was able to reproduce this now 🎉

Reproduction steps:

  1. Create a new postgres instance on Heroku
  2. Initialise a new project using prisma2 init flow and the credentials obtained from above(remember that SSL is required)
  3. Run `prisma2 lift save --name ‘init’
  4. See the error.

image

Version: prisma2@2.0.0-preview-7, binary version: 33e5fc84b6bd61602f8d634beb558230ca3e3054

Rust backtrace:

LiftEngine:stderr thread 'main' panicked at 'Box<Any>', migration-engine/core/src/main.rs:57:23 +0ms
  LiftEngine:stderr stack backtrace: +29ms
  LiftEngine:stderr    0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace +1ms
  LiftEngine:stderr    1: std::sys_common::backtrace::_print +0ms
  LiftEngine:stderr    2: std::panicking::default_hook::{{closure}} +0ms
  LiftEngine:stderr    3: std::panicking::default_hook +0ms
  LiftEngine:stderr    4: std::panicking::rust_panic_with_hook +0ms
  LiftEngine:stderr    5: std::panicking::begin_panic +0ms
  LiftEngine:stderr    6: migration_engine::main +0ms
  LiftEngine:stderr    7: std::rt::lang_start::{{closure}} +0ms
  LiftEngine:stderr    8: std::panicking::try::do_call +0ms
  LiftEngine:stderr    9: __rust_maybe_catch_panic +0ms
  LiftEngine:stderr   10: std::rt::lang_start_internal +0ms
  LiftEngine:stderr   11: main +0ms

This is not reproducible anymore with

divyendusingh [p2-pg]$ prisma2 --version
prisma2@2.0.0-preview-9.1, binary version: bbbeff6f84b408e534ebd866bfd378748e6d6611

I tried these situations (wrong user, missing port, local or remote pg, missing env, wrong env).

I am closing this one, if you still run into this issue, please create a new GH issue possibly with a minimal reproduction and tag me there 🙌

I’m seeing the same error locally, with mysql.

@pantharshit00 Ok this is what I’m getting on Heroku

remote: Building source:
remote: 
remote: -----> Node.js app detected
remote:        
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:        
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:        engines.yarn (package.json):  unspecified (use default)
remote:        
remote:        Resolving node version 10.x...
remote:        Downloading and installing node 10.16.3...
remote:        Using default npm version: 6.9.0
remote:        Resolving yarn version 1.x...
remote:        Downloading and installing yarn (1.17.3)...
remote:        Installed yarn 1.17.3
remote:        
remote: -----> Restoring cache
remote:        - yarn cache
remote:        
remote: -----> Installing dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v1.17.3
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        [3/4] Linking dependencies...
remote:        [4/4] Building fresh packages...
remote:        $ export DEBUG=* && prisma2 generate && prisma2 lift up
remote:        2019-08-22T13:05:22.947Z getos { version: 'OpenSSL 1.1.0g  2 Nov 2017\n' }
remote:        2019-08-22T13:05:22.948Z getos { ls: '' }
remote:        2019-08-22T13:05:22.948Z getos { platform: 'linux', libssl: '1.1.0' }
remote:        2019-08-22T13:05:22.976Z getos { version: 'OpenSSL 1.1.0g  2 Nov 2017\n' }
remote:        2019-08-22T13:05:22.976Z getos { ls: '' }
remote:        2019-08-22T13:05:22.976Z getos { platform: 'linux', libssl: '1.1.0' }
remote:        2019-08-22T13:05:23.005Z getCompiledGenerators { g:
remote:           { name: 'photon',
remote:             provider: 'photonjs',
remote:             output: null,
remote:             platforms: [ 'native', 'linux-glibc-libssl1.0.2' ],
remote:             pinnedPlatform: null,
remote:             config: {} },
remote:          cwd: '/tmp/build_ccace8a79a2146276f0a9ada1f6f2636/prisma/',
remote:          nodeModulesBase: '/tmp/build_ccace8a79a2146276f0a9ada1f6f2636' }
remote:        2019-08-22T13:05:23.005Z getCompiledGenerators { g:
remote:           { name: 'nexus_prisma',
remote:             provider: 'nexus-prisma',
remote:             output: null,
remote:             platforms: [],
remote:             pinnedPlatform: null,
remote:             config: {} },
remote:          cwd: '/tmp/build_ccace8a79a2146276f0a9ada1f6f2636/prisma/',
remote:          nodeModulesBase: '/tmp/build_ccace8a79a2146276f0a9ada1f6f2636' }
remote:        Generating Photon.js Client to /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/@generated/photon
remote:        2019-08-22T13:05:23.009Z photon:generatorDefinition { pkg:
remote:           { name: 'prisma2',
remote:             version: '2.0.0-preview-7',
remote:             main: 'dist/index.js',
remote:             types: 'dist/index.d.ts',
remote:             repository: 'git@github.com:prisma/prisma2-cli.git',
remote:             author: 'Tim Suchanek <suchanek@prisma.io>',
remote:             license: 'Apache-2.0',
remote:             private: false,
remote:             files:
remote:              [ 'build',
remote:                'download-build',
remote:                'runtime/*.js',
remote:                'runtime/*.d.ts',
remote:                'runtime/utils',
remote:                'runtime/dist',
remote:                'nexus_prisma_ncc_build' ],
remote:             bin: { prisma2: 'build/index.js' },
remote:             prisma: { version: '33e5fc84b6bd61602f8d634beb558230ca3e3054' },
remote:             devDependencies:
remote:              { '@prisma/cli': '^0.0.46',
remote:                '@prisma/fetch-engine': '^0.1.6',
remote:                '@prisma/introspection': '0.0.52',
remote:                '@prisma/lift': '0.2.2',
remote:                '@prisma/photon': '^0.2.3',
remote:                '@sentry/node': '5',
remote:                '@types/mocha': '^5.2.7',
remote:                '@zeit/ncc': '^0.18.5',
remote:                dotenv: '^8.0.0',
remote:                jest: '24.8.0',
remote:                mocha: '6.1.4',
remote:                mz: '2.7.0',
remote:                'nexus-prisma': '0.0.1-beta.4',
remote:                open: '^6.4.0',
remote:                'pkg-up': '3.1.0',
remote:                'prisma-test-utils': '^0.2.5',
remote:                'serialize-error': '^4.1.0',
remote:                'strip-ansi': '^5.2.0',
remote:                'terminal-link': '^1.3.0',
remote:                tmp: '^0.1.0',
remote:                'ts-jest': '24.0.2',
remote:                'ts-mocha': '6.0.0',
remote:                typescript: '3.5.2' },
remote:             scripts:
remote:              { test:
remote:                 './node_modules/.bin/mocha src/__tests__/integrate.test.ts --require ts-mocha src/__tests__/integrate.test.ts --timeout 10s',
remote:                'test:debug':
remote:                 './node_modules/.bin/mocha --inspect-brk src/__tests__/integrate.test.ts --require ts-mocha src/__tests__/integrate.test.ts --timeout 10s',
remote:                install:
remote:                 'test -f download-build/index.js && node download-build/index.js || echo ""',
remote:                tsc: 'tsc -d && cp src/capture-worker.js dist/capture-worker.js',
remote:                ncc: 'ncc build dist/bin.js -o build',
remote:                'ncc:download': 'ncc build scripts/download.js -o download-build',
remote:                build:
remote:                 'yarn tsc && yarn ncc:download && rm -rf build && yarn ncc && sed -i.bak \'s/env ts-node/env node/g\' \'build/index.js\' && rm -f build/index.js.bak && scripts/copy-runtime.sh',
remote:                prepublishOnly: 'node scripts/updateTag.js && yarn build',
remote:                prepare: 'yarn build && node download-build/index.js',
remote:                'update-deps': 'yarn upgrade --latest --scope @prisma' },
remote:             dependencies: {},
remote:             resolutions:
remote:              { 'prisma-datamodel': '1.36.0-alpha.8',
remote:                '**/prisma-datamodel': '1.36.0-alpha.8',
remote:                '**/**/prisma-datamodel': '1.36.0-alpha.8',
remote:                '**/**/**/prisma-datamodel': '1.36.0-alpha.8' } },
remote:          version: '33e5fc84b6bd61602f8d634beb558230ca3e3054' }
remote:        2019-08-22T13:05:23.044Z getos { version: 'OpenSSL 1.1.0g  2 Nov 2017\n' }
remote:        2019-08-22T13:05:23.044Z getos { ls: '' }
remote:        2019-08-22T13:05:23.044Z getos { platform: 'linux', libssl: '1.1.0' }
remote:        2019-08-22T13:05:23.060Z getos { version: 'OpenSSL 1.1.0g  2 Nov 2017\n' }
remote:        2019-08-22T13:05:23.060Z getos { ls: '' }
remote:        2019-08-22T13:05:23.060Z getos { platform: 'linux', libssl: '1.1.0' }
remote:        2019-08-22T13:05:23.101Z getos { version: 'OpenSSL 1.1.0g  2 Nov 2017\n' }
remote:        2019-08-22T13:05:23.101Z getos { ls: '' }
remote:        2019-08-22T13:05:23.102Z getos { platform: 'linux', libssl: '1.1.0' }
remote:        2019-08-22T13:05:29.699Z getos { version: 'OpenSSL 1.1.0g  2 Nov 2017\n' }
remote:        2019-08-22T13:05:29.699Z getos { ls: '' }
remote:        2019-08-22T13:05:29.699Z getos { platform: 'linux', libssl: '1.1.0' }
remote:        2019-08-22T13:05:29.701Z download Downloading https://s3-eu-west-1.amazonaws.com/prisma-native/alpha/33e5fc84b6bd61602f8d634beb558230ca3e3054/linux-glibc-libssl1.0.2/prisma.gz to /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/query-engine-linux-glibc-libssl1.0.2
remote:        
remote:        
remote:        
remote:        
remote:        2019-08-22T13:05:30.941Z generateClient Copying /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/query-engine-linux-glibc-libssl1.1.0 to /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/@generated/photon/runtime/query-engine-linux-glibc-libssl1.1.0
remote:        2019-08-22T13:05:30.956Z generateClient Copying /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/query-engine-linux-glibc-libssl1.0.2 to /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/@generated/photon/runtime/query-engine-linux-glibc-libssl1.0.2
remote:        Done in 7.97s
remote:        Generating Nexus Prisma to /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/@generated/nexus-prisma
remote:        Done in 73ms
remote:        
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:compiler initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:parser initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:compiler initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:parser initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:compiler initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:parser initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:compiler initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:parser initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:compiler initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:parser initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:compiler initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:parser initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:compiler initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:parser initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:compiler initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        Thu, 22 Aug 2019 13:05:32 GMT snapdragon:parser initializing /tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js
remote:        2019-08-22T13:05:32.564Z LiftEngine:rpc SENDING RPC CALL { id: 1,
remote:          jsonrpc: '2.0',
remote:          method: 'listMigrations',
remote:          params:
remote:           { projectInfo: '',
remote:             sourceConfig:
remote:              'datasource db {\n  provider = "postgresql"\n  url      = env("POSTGRES_URL")\n}\n\ngenerator photon {\n  provider = "photonjs"\n  platforms = ["native", "linux-glibc-libssl1.0.2"]\n}\n\ngenerator nexus_prisma {\n  provider = "nexus-prisma"\n}\n\nmodel User {\n  id    String  @default(cuid()) @id @unique\n  email String  @unique\n  name  String?\n  posts Post[]\n  role  Role?\n}\n\nmodel Post {\n  id        String   @default(cuid()) @id @unique\n  createdAt DateTime @default(now())\n  updatedAt DateTime @updatedAt\n  published Boolean\n  title     String\n  content   String?\n  author    User?\n}\n\nmodel Role {\n  id    String  @default(cuid()) @id @unique\n  name  String?\n  users User[]\n}' } }
remote:        2019-08-22T13:05:35.580Z LiftEngine:stderr thread 'main' panicked at 'Box<Any>', migration-engine/core/src/main.rs:57:23
remote:        2019-08-22T13:05:35.590Z LiftEngine:stderr stack backtrace:
remote:        2019-08-22T13:05:35.591Z LiftEngine:stderr    0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
remote:        2019-08-22T13:05:35.605Z LiftEngine:stderr              at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
remote:        2019-08-22T13:05:35.605Z LiftEngine:stderr    1: std::sys_common::backtrace::_print
remote:        2019-08-22T13:05:35.605Z LiftEngine:stderr              at src/libstd/sys_common/backtrace.rs:71
remote:        2019-08-22T13:05:35.605Z LiftEngine:stderr    2: std::panicking::default_hook::{{closure}}
remote:        2019-08-22T13:05:35.605Z LiftEngine:stderr              at src/libstd/sys_common/backtrace.rs:59
remote:        2019-08-22T13:05:35.606Z LiftEngine:stderr              at src/libstd/panicking.rs:197
remote:        2019-08-22T13:05:35.606Z LiftEngine:stderr    3: std::panicking::default_hook
remote:        2019-08-22T13:05:35.606Z LiftEngine:stderr              at src/libstd/panicking.rs:211
remote:        2019-08-22T13:05:35.608Z LiftEngine:stderr    4: std::panicking::rust_panic_with_hook
remote:        2019-08-22T13:05:35.608Z LiftEngine:stderr              at src/libstd/panicking.rs:474
remote:        2019-08-22T13:05:35.608Z LiftEngine:stderr    5: std::panicking::begin_panic
remote:        2019-08-22T13:05:35.608Z LiftEngine:stderr    6: migration_engine::main
remote:        2019-08-22T13:05:35.608Z LiftEngine:stderr    7: std::rt::lang_start::{{closure}}
remote:        2019-08-22T13:05:35.609Z LiftEngine:stderr    8: std::panicking::try::do_call
remote:        2019-08-22T13:05:35.609Z LiftEngine:stderr              at src/libstd/rt.rs:49
remote:        2019-08-22T13:05:35.609Z LiftEngine:stderr              at src/libstd/panicking.rs:293
remote:        2019-08-22T13:05:35.609Z LiftEngine:stderr    9: __rust_maybe_catch_panic
remote:        2019-08-22T13:05:35.609Z LiftEngine:stderr              at src/libpanic_unwind/lib.rs:87
remote:        2019-08-22T13:05:35.609Z LiftEngine:stderr   10: std::rt::lang_start_internal
remote:        2019-08-22T13:05:35.609Z LiftEngine:stderr              at src/libstd/panicking.rs:272
remote:        2019-08-22T13:05:35.610Z LiftEngine:stderr              at src/libstd/panic.rs:388
remote:        2019-08-22T13:05:35.610Z LiftEngine:stderr              at src/libstd/rt.rs:48
remote:        2019-08-22T13:05:35.610Z LiftEngine:stderr   11: main
remote:        2019-08-22T13:05:35.610Z LiftEngine:stderr   12: __libc_start_main
remote:        2019-08-22T13:05:35.610Z LiftEngine:stderr   13: _start
remote:        Error: Error: Got invalid RPC response without .result property: {}
remote:            at registerCallback.response (/tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js:134308:36)
remote:            at Object.entries.map (/tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js:134195:13)
remote:            at Array.map (<anonymous>)
remote:            at LiftEngine.rejectAll (/tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js:134194:40)
remote:            at ChildProcess.child.on (/tmp/build_ccace8a79a2146276f0a9ada1f6f2636/node_modules/prisma2/build/index.js:134256:30)
remote:            at ChildProcess.emit (events.js:198:13)
remote:            at ChildProcess.EventEmitter.emit (domain.js:448:20)
remote:            at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
remote:        error Command failed with exit code 1.
remote:        info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:        
remote:        Some possible problems:
remote:        
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:        
remote:        Love,
remote:        Heroku
remote:        
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed

Yes, I just did. Working now. I do remember in v1, it used to show a clearer error if username wasn’t specified.

@alizahid

Try specifying a user then.

datasource db {
  provider = "postgresql"
  url      = "postgresql://postgres:postgres@localhost:5432/bother?schema=public"
}