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 [email protected], 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?
I am really unable to reproduce this.


Can you try running the migration again with export RUST_BACKTRACE=1 so that we can get a full backtrace?
RUST_BACKTRACE=1 prisma2 lift save --name 'init' doesn't show any stack trace. Am I doing this wrong?
Well in that case, can you please make sure that bother database exists in your database.
It exists. Prisma wouldnโt init without it.
Its working with local Postgres, but it doesn't work & same error appears with Heroku managed Postgres DB instances.
Thanks, I was able to reproduce this now ๐
Reproduction steps:
prisma2 init flow and the credentials obtained from above(remember that SSL is required)
Version: [email protected], 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
I'm seeing the same error locally, with mysql.
@kleydon
Can you please share the output of the command using export DEBUG=* set?
I'm also getting this error trying to deploy to Heroku but am using RDS for a postgres db. Possibly due to photon generating into a temp folder?
repo: https://github.com/ryanking1809/prisma2-zeit-now
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.21 KiB | 620.00 KiB/s, done.
Total 12 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
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: $ prisma2 generate && prisma2 lift up
remote: Generating Photon.js Client to /tmp/build_faf6b398170190afc1f8a7a3163d100f/node_modules/@generated/photon
remote:
remote:
remote:
remote:
remote: Done in 8.26s
remote: Generating Nexus Prisma to /tmp/build_faf6b398170190afc1f8a7a3163d100f/node_modules/@generated/nexus-prisma
remote: Done in 56ms
remote:
remote: Error: Got invalid RPC response without .result property: {}
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
@ryanking1809 It is more related to the database connection.
Can you share the output of the lift command with export DEBUG=* enabled?
@pantharshit00 sorry a bit of a newbie here. Where / how do I enable export DEBUG=*?
Okay, setting the debug flag showed this error: Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet
Full stack
Last login: Wed Aug 21 17:48:25 on ttys003
โ api DEBUG=* prisma2 lift save --name init
LiftEngine:rpc SENDING RPC CALL {
id: 1,
jsonrpc: '2.0',
method: 'listMigrations',
params: {
projectInfo: '',
sourceConfig: 'datasource db {\n' +
' provider = "postgresql"\n' +
' url = "postgresql://localhost:5432/bother?schema=public"\n' +
'}\n' +
'\n' +
'generator photonjs {\n' +
' provider = "photonjs"\n' +
'}\n' +
'\n' +
'model Post {\n' +
' id String @id @default(cuid())\n' +
' body String\n' +
' comments Comment[]\n' +
' location Float[]\n' +
' rating Int\n' +
' ratings Rating[]\n' +
' user User\n' +
' created DateTime @default(now())\n' +
'}\n' +
'\n' +
'model Rating {\n' +
' id String @id @default(cuid())\n' +
' direction Int @default(1)\n' +
' post Post\n' +
' user User\n' +
' created DateTime @default(now())\n' +
' updated DateTime @updatedAt\n' +
'}\n' +
'\n' +
'model Comment {\n' +
' id String @id @default(cuid())\n' +
' body String\n' +
' post Post\n' +
' user User\n' +
' created DateTime @default(now())\n' +
'}\n' +
'\n' +
'model User {\n' +
' id String @id @default(cuid())\n' +
' notifications Boolean\n' +
' platform String\n' +
' posts Post[]\n' +
' push_token String\n' +
' created DateTime @default(now())\n' +
' updated DateTime @updatedAt\n' +
'}'
}
} +0ms
LiftEngine:stderr [2019-08-22T12:38:19Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +0ms
LiftEngine:stderr [2019-08-22T12:38:19Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +0ms
LiftEngine:stderr [2019-08-22T12:38:19Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +403ms
LiftEngine:stderr [2019-08-22T12:38:19Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +0ms
LiftEngine:stderr [2019-08-22T12:38:20Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +762ms
LiftEngine:stderr [2019-08-22T12:38:20Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +1ms
LiftEngine:stderr [2019-08-22T12:38:20Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +284ms
LiftEngine:stderr [2019-08-22T12:38:20Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +0ms
LiftEngine:stderr [2019-08-22T12:38:21Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +406ms
LiftEngine:stderr [2019-08-22T12:38:21Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +0ms
LiftEngine:stderr [2019-08-22T12:38:22Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +755ms
LiftEngine:stderr [2019-08-22T12:38:22Z ERROR r2d2] Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet +0ms
LiftEngine:stderr thread 'main' panicked at 'Box<Any>', migration-engine/core/src/main.rs:57:23 +347ms
LiftEngine:stderr stack backtrace: +198ms
LiftEngine:stderr 0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace +0ms
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 +1ms
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
Error: Error: Got invalid RPC response without .result property: {}
at /Users/alizahid/.config/yarn/global/node_modules/prisma2/build/index.js:134308:36
at /Users/alizahid/.config/yarn/global/node_modules/prisma2/build/index.js:134195:13
at Array.map (<anonymous>)
at LiftEngine.rejectAll (/Users/alizahid/.config/yarn/global/node_modules/prisma2/build/index.js:134194:40)
at ChildProcess.<anonymous> (/Users/alizahid/.config/yarn/global/node_modules/prisma2/build/index.js:134256:30)
at ChildProcess.emit (events.js:203:13)
at ChildProcess.EventEmitter.emit (domain.js:476:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
โ api
I will init again and pass all parameters. But I guess the error could be better?
@ryanking1809 DEBUG is just an environment variable.
So run export DEBUG=* before running the lift command. That will add DEBUG to the environment variables for that terminal session. * value means log everything.
So run
export DEBUG=*
prisma lift save
Marking this as a regression since preview-6.1 works with all of my test case(I tested with Heroku and render.com).
Also, the CLI is throwing the same error if any environment variable is not found.
@alizahid
Try specifying a user then.
datasource db {
provider = "postgresql"
url = "postgresql://postgres:postgres@localhost:5432/bother?schema=public"
}
Yes, I just did. Working now. I do remember in v1, it used to show a clearer error if username wasn't specified.
I guess since we parse the URL on our own we don't have a default.
@mavilein Can you please confirm this?
@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: '[email protected]:prisma/prisma2-cli.git',
remote: author: 'Tim Suchanek <[email protected]>',
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
@pantharshit00 wrote:
Can you please share the output of the command using export DEBUG=* set?
Sure:
backend krispin$ export DEBUG=*
backend krispin$ prisma2 lift save --name init
LiftEngine:rpc SENDING RPC CALL {
id: 1,
jsonrpc: '2.0',
method: 'listMigrations',
params: {
projectInfo: '',
sourceConfig: '\n' +
'datasource db {\n' +
' provider = "mysql"\n' +
' url = env("MYSQL_URL")\n' +
'}\n' +
'\n' +
'generator photon {\n' +
' provider = "photonjs"\n' +
' platforms = ["native", "linux-glibc-libssl1.0.2"]\n' +
'}\n' +
'\n' +
'generator nexus_prisma {\n' +
' provider = "nexus-prisma"\n' +
'}\n' +
'\n' +
'\n' +
'model User {\n' +
' id String @default(cuid()) @id @unique\n' +
' email String @unique\n' +
' phone String?\n' +
' name String?\n' +
' posts Post[]\n' +
'}\n' +
'\n' +
'\n' +
'model 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' +
'}'
}
} +0ms
LiftEngine:stderr error: Environment variable not found: MYSQL_URL. +0ms
LiftEngine:stderr --> schema.prisma:4 +0ms
LiftEngine:stderr | +0ms
LiftEngine:stderr 3 | provider = "mysql" +0ms
LiftEngine:stderr 4 | url = env("MYSQL_URL") +1ms
LiftEngine:stderr 5 | } +0ms
LiftEngine:stderr | +0ms
Error: Error: Got invalid RPC response without .result property: {}
at /usr/local/lib/node_modules/prisma2/build/index.js:134308:36
at /usr/local/lib/node_modules/prisma2/build/index.js:134195:13
at Array.map ()
at LiftEngine.rejectAll (/usr/local/lib/node_modules/prisma2/build/index.js:134194:40)
at ChildProcess.(/usr/local/lib/node_modules/prisma2/build/index.js:134256:30)
at ChildProcess.emit (events.js:203:13)
at ChildProcess.EventEmitter.emit (domain.js:476:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
@pimeys will take it up in the coming weeks.
Heads up, confirmed still an issue with [email protected] and [email protected], attached output. Introspect works fine... credentials correct as well.
````
โ graphql git:(master) โ prisma2 lift save
Error: Got invalid RPC response without .result property: {}
โ graphql git:(master) โ DEBUG=* prisma2 lift save --name "init"
LiftEngine:rpc SENDING RPC CALL {
id: 1,
jsonrpc: '2.0',
method: 'listMigrations',
params: {
projectInfo: '',
sourceConfig: 'datasource db {\n' +
' provider = "postgresql"\n' +
' url = "postgresql://exampleuser:[email protected]:5432/databasename?schema=public&sslmode=prefer"\n' +
'}\n' +
'\n' +
'generator photon {\n' +
' provider = "photonjs"\n' +
'}\n' +
'\n' +
'generator nexus_prisma {\n' +
' provider = "nexus-prisma"\n' +
'}\n' +
'\n' +
'model User {\n' +
' id String @default(cuid()) @id @unique\n' +
' email String @unique\n' +
' name String?\n' +
' posts Post[]\n' +
'}\n' +
'\n' +
'model 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' +
'}'
}
} +0ms
LiftEngine:stderr [2019-08-25T23:24:41Z ERROR r2d2] Error querying the database: db error: FATAL: permission denied for database "postgres" +0ms
LiftEngine:stderr [2019-08-25T23:24:41Z ERROR r2d2] Error querying the database: db error: FATAL: permission denied for database "postgres" +14ms
LiftEngine:stderr thread 'main' panicked at 'Box
LiftEngine:stderr stack backtrace: +0ms
LiftEngine:stderr 0: std::panicking::default_hook::{{closure}} +26ms
LiftEngine:stderr 1: std::panicking::default_hook +0ms
LiftEngine:stderr 2: std::panicking::rust_panic_with_hook +0ms
LiftEngine:stderr 3: std::panicking::begin_panic +0ms
LiftEngine:stderr 4: migration_engine::main +0ms
LiftEngine:stderr 5: std::rt::lang_start::{{closure}} +0ms
LiftEngine:stderr 6: std::panicking::try::do_call +0ms
LiftEngine:stderr 7: __rust_maybe_catch_panic +0ms
LiftEngine:stderr 8: std::rt::lang_start_internal +0ms
LiftEngine:stderr 9: main +0ms
Error: Error: Got invalid RPC response without .result property: {}
at /Users/brad/n/lib/node_modules/prisma2/build/index.js:134190:36
at /Users/brad/n/lib/node_modules/prisma2/build/index.js:134077:13
at Array.map (
at LiftEngine.rejectAll (/Users/brad/n/lib/node_modules/prisma2/build/index.js:134076:40)
at ChildProcess.
at ChildProcess.emit (events.js:203:13)
at ChildProcess.EventEmitter.emit (domain.js:471:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
โ graphql git:(master) โ npm -g list prisma2
/Users/brad/n/lib
โโโ [email protected]
โ graphql git:(master) โ DEBUG=* prisma2 introspect
PostgresIntrospection Listing schemas. +0ms
RelationalIntrospection Querying schemas. +0ms
โ Introspecting database public RelationalIntrospection Introspecting models in schema public. +206ms
RelationalIntrospection Querying tables. +0ms
PostgresIntrospection Querying column comments for public +208ms
RelationalIntrospection Querying columns for schema public. +1ms
PostgresIntrospection Querying indices for table public. +0ms
RelationalIntrospection Querying relations in schema public. +1ms
PostgresIntrospection Querying enums for schema public. +1ms
PostgresIntrospection Querying sqeuences. +0ms
โ Introspecting database public PostgresIntrospection Creating postgres specific introspection result. +3s
RelationalIntrospectionResult Datamodel inferrence started. +0ms
RelationalIntrospectionResult Basic types inferred. +1ms
RelationalIntrospectionResult Id fields resolved. +0ms
RelationalIntrospectionResult Default values inferred. +0ms
RelationalIntrospectionResult Relations resolved. +1ms
RelationalIntrospectionResult Relations enums resolved. +0ms
RelationalIntrospectionResult Extra artifacts hidden. +0ms
RelationalIntrospectionResult Validation done. +1ms
RelationalIntrospectionResult Normalization done. +0ms
RelationalIntrospectionResult Inferring done. +0ms
โ Introspecting database public: 2.6s
Created datamodel definition based on 0 database tables
Created 1 new file: Prisma DML datamodel (derived from existing database)
datamodel-1566775553.prisma
โ graphql git:(master) โ โ graphql git:(master) โ npm -g list prisma2
/Users/brad/n/lib
โโโ [email protected]
โ graphql git:(master) โ DEBUG=* prisma2 introspect
PostgresIntrospection Listing schemas. +0ms
RelationalIntrospection Querying schemas. +0ms
โ Introspecting database public RelationalIntrospection Introspecting models in schema public. +206ms
RelationalIntrospection Querying tables. +0ms
PostgresIntrospection Querying column comments for public +208ms
RelationalIntrospection Querying columns for schema public. +1ms
PostgresIntrospection Querying indices for table public. +0ms
RelationalIntrospection Querying relations in schema public. +1ms
PostgresIntrospection Querying enums for schema public. +1ms
PostgresIntrospection Querying sqeuences. +0ms
โ Introspecting database public PostgresIntrospection Creating postgres specific introspection result. +3s
RelationalIntrospectionResult Datamodel inferrence started. +0ms
RelationalIntrospectionResult Basic types inferred. +1ms
RelationalIntrospectionResult Id fields resolved. +0ms
RelationalIntrospectionResult Default values inferred. +0ms
RelationalIntrospectionResult Relations resolved. +1ms
RelationalIntrospectionResult Relations enums resolved. +0ms
RelationalIntrospectionResult Extra artifacts hidden. +0ms
RelationalIntrospectionResult Validation done. +1ms
RelationalIntrospectionResult Normalization done. +0ms
RelationalIntrospectionResult Inferring done. +0ms
โ Introspecting database public: 2.6s
Created datamodel definition based on 0 database tables
Created 1 new file: Prisma DML datamodel (derived from existing database)
datamodel-1566775553.prisma
further information : wasn't able to replicate this issue with a local docker image of postgres 11.. might have something to do with the connection string or heroku..
I might also add I've avoided the issue with a dockerfile (in Heroku) containing the following:
FROM node:10.16.0
RUN npm install -g --unsafe-perm prisma2
RUN mkdir /app
WORKDIR /app
COPY package*.json ./
COPY ./src/ ./src/
COPY prisma ./prisma/
ARG POSTGRES_URL
ENV POSTGRES_URL "$POSTGRES_URL"
RUN npm install
RUN prisma2 generate
RUN prisma2 lift up
CMD ["npm", "start" ]
reconfirmed - this definitely does look to be something specific at least to heroku database instances, not version of postgresql or connection string from what I can see, local docker postgres works fine as does digital ocean hosted postgres...
I got this working, you need to make sure you have the correct environment variables set up in Heroku first, before deploy ๐คฆ๐ผโโ๏ธSo this repo will work provided you set up the POSTGRES_URL before deploy. Sorry, should have picked up on that one earlier!
This is not reproducible anymore with
divyendusingh [p2-pg]$ prisma2 --version
[email protected], 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 ๐
Most helpful comment
Thanks, I was able to reproduce this now ๐
Reproduction steps:
prisma2 initflow and the credentials obtained from above(remember that SSL is required)Version: [email protected], binary version: 33e5fc84b6bd61602f8d634beb558230ca3e3054
Rust backtrace: