Production database is not building

Hello people,

I’m working on my deployment on netlify, so far I had to fix a couple of issues ( prod vars & apiProxyPath for instance ) but I managed to have the app boot up in the browser.

However I’m stuck, the build, even though it claims to have created the database, has not. I can only access a _migrations table.
I don’t have migrations to execute.
I have tried the following:

  • deploying after clearing the cache
  • recreating the schema manually ( only the schema, no tables at all )

None of my tables are created by the deploy.

My connect string is correct & confirmed,
BINARY_TARGET = rhel-openssl-1.0.x

Redwood.toml

[web]
  port = 8910
  apiProxyPath = "/.netlify/functions"
  includeEnvironmentVariables = ['FIREBASE_API_KEY','FIREBASE_AUTH_DOMAIN','FIREBASE_DATABASE_URL','FIREBASE_PROJECT_ID','FIREBASE_STORAGE_BUCKET','FIREBASE_MESSAGING_SENDER_ID','FIREBASE_APP_ID']
[api]
  port = 8911
[browser]
  open = true

netlify.toml

[build]
  command = "yarn rw db up --no-db-client --auto-approve && yarn rw build"
  publish = "web/dist"
  functions = "api/dist/functions"

[context.production]
  # private vars for Firebase auth

[dev]
  command = "yarn rw dev"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Deploy log

9:58:50 AM: Build ready to start
9:58:52 AM: build-image version: 3031d4c9e432fd7016f6279fc9ad706f9205d845
9:58:52 AM: build-image tag: v3.3.17
9:58:52 AM: buildbot version: 1f35b3abd6e2bf5230d8edf68072840fdec1513f
9:58:52 AM: Fetching cached dependencies
9:58:52 AM: Starting to download cache of 254.2KB
9:58:52 AM: Finished downloading cache in 65.576167ms
9:58:52 AM: Starting to extract cache
9:58:52 AM: Failed to fetch cache, continuing with build
9:58:52 AM: Starting to prepare the repo for build
9:58:53 AM: No cached dependencies found. Cloning fresh repo
9:58:53 AM: git clone git@bitbucket.org:noire_munich/afterreading
9:58:56 AM: Preparing Git Reference refs/heads/main
9:58:57 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn rw db up --no-db-client --auto-approve && yarn rw build' versus 'yarn rw db up --no-db-client && yarn rw build' in the Netlify UI
9:58:57 AM: Starting build script
9:58:57 AM: Installing dependencies
9:58:57 AM: Python version set to 2.7
9:58:57 AM: Attempting node version 'lts/*' from .nvmrc
9:58:58 AM: Downloading and installing node v12.18.1...
9:58:58 AM: Downloading https://nodejs.org/dist/v12.18.1/node-v12.18.1-linux-x64.tar.xz...
9:58:58 AM: Computing checksum with sha256sum
9:58:59 AM: Checksums matched!
9:59:01 AM: Now using node v12.18.1 (npm v6.14.5)
9:59:01 AM: Started restoring cached build plugins
9:59:01 AM: Finished restoring cached build plugins
9:59:01 AM: Attempting ruby version 2.6.2, read from environment
9:59:02 AM: Using ruby version 2.6.2
9:59:03 AM: Using PHP version 5.6
9:59:03 AM: 5.2 is already installed.
9:59:03 AM: Using Swift version 5.2
9:59:03 AM: Started restoring cached node modules
9:59:03 AM: Finished restoring cached node modules
9:59:03 AM: Started restoring cached yarn cache
9:59:03 AM: Finished restoring cached yarn cache
9:59:03 AM: Installing yarn at version 1.17.0
9:59:03 AM: Installing Yarn!
9:59:03 AM: > Downloading tarball...
9:59:03 AM: [1/2]: https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz --> /tmp/yarn.tar.gz.zrXBok1GYJ
9:59:03 AM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
9:59:03 AM:                                  Dload  Upload   Total   Spent    Left  Speed
9:59:03 AM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
9:59:03 AM: 100    80  100    80    0     0    279      0 --:--:-- --:--:-- --:--:--   280
9:59:03 AM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
9:59:03 AM: 100    93  100    93    0     0    155      0 --:--:-- --:--:-- --:--:--   560
9:59:04 AM: 100   630  100   630    0     0    725      0 --:--:-- --:--:-- --:--:--   725
9:59:04 AM: 100 1213k  100 1213k    0     0   886k      0  0:00:01  0:00:01 --:--:--  886k
9:59:04 AM: [2/2]: https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz.asc --> /tmp/yarn.tar.gz.zrXBok1GYJ.asc
9:59:04 AM: 100    84  100    84    0     0   3112      0 --:--:-- --:--:-- --:--:--  3112
9:59:04 AM:   0    97    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
9:59:04 AM: 100    97  100    97    0     0   1776      0 --:--:-- --:--:-- --:--:-- 97000
9:59:04 AM: 100   634  100   634    0     0   7312      0 --:--:-- --:--:-- --:--:--  7312
9:59:04 AM: 100   832  100   832    0     0   6350      0 --:--:-- --:--:-- --:--:--  6350
9:59:04 AM: > Verifying integrity...
9:59:04 AM: gpg: Signature made Fri 14 Jun 2019 06:55:58 PM UTC using RSA key ID 69475BAA
9:59:04 AM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
9:59:04 AM: gpg: WARNING: This key is not certified with a trusted signature!
9:59:04 AM: gpg:          There is no indication that the signature belongs to the owner.
9:59:04 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
9:59:04 AM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
9:59:04 AM: > GPG signature looks good
9:59:04 AM: > Extracting to ~/.yarn...
9:59:04 AM: > Adding to $PATH...
9:59:05 AM: > Successfully installed Yarn 1.17.0! Please open another terminal where the `yarn` command will now be available.
9:59:05 AM: Installing NPM modules using Yarn version 1.17.0
9:59:06 AM: yarn install v1.17.0
9:59:06 AM: [1/5] Validating package.json...
9:59:06 AM: [2/5] Resolving packages...
9:59:08 AM: [3/5] Fetching packages...
9:59:46 AM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
9:59:46 AM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
9:59:46 AM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
9:59:46 AM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
9:59:46 AM: [4/5] Linking dependencies...
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing@0.12.0" has unmet peer dependency "@redwoodjs/router@*".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing@0.12.0" has unmet peer dependency "react@*".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web@0.12.0" has unmet peer dependency "prop-types@*".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web@0.12.0" has unmet peer dependency "react@*".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing > @testing-library/react@10.3.0" has unmet peer dependency "react@*".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing > @testing-library/react@10.3.0" has unmet peer dependency "react-dom@*".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > @apollo/react-components@3.1.5" has unmet peer dependency "@types/react@^16.8.0".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-cache@^1.3.2".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-client@^2.6.4".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-link@^1.2.12".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-utilities@^1.3.2".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > @apollo/react-components@3.1.5" has unmet peer dependency "graphql@^14.3.1".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > @apollo/react-components@3.1.5" has unmet peer dependency "react@^16.8.0".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > @apollo/react-components@3.1.5" has unmet peer dependency "react-dom@^16.8.0".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-hooks@3.1.5" has unmet peer dependency "react@^16.8.0".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-hooks@3.1.5" has unmet peer dependency "react-dom@^16.8.0".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > react-hook-form@5.7.2" has unmet peer dependency "react@^16.8.0".
9:59:46 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-components > @apollo/react-common@3.1.4" has unmet peer dependency "react@^16.8.0".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > web > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > api > firebase-admin > @firebase/database > @firebase/auth-interop-types@0.1.5" has unmet peer dependency "@firebase/app-types@0.x".
9:59:46 AM: warning "workspace-aggregator-50970d75-f1b8-4503-a6f5-6e2bafcc6d98 > web > firebase > @firebase/firestore > @grpc/grpc-js@1.1.0" has unmet peer dependency "google-auth-library@5.x || 6.x".
10:00:09 AM: [5/5] Building fresh packages...
10:00:17 AM: success Saved lockfile.
10:00:17 AM: Done in 71.56s.
10:00:17 AM: NPM modules installed using Yarn
10:00:17 AM: Started restoring cached go cache
10:00:17 AM: Finished restoring cached go cache
10:00:17 AM: Installing Go version 1.12
10:00:22 AM: unset GOOS;
10:00:22 AM: unset GOARCH;
10:00:22 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
10:00:22 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
10:00:22 AM: go version >&2;
10:00:22 AM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
10:00:22 AM: go version go1.12 linux/amd64
10:00:22 AM: Installing missing commands
10:00:22 AM: Verify run directory
10:00:23 AM: ​
10:00:23 AM: ┌─────────────────────────────┐
10:00:23 AM: │        Netlify Build        │
10:00:23 AM: └─────────────────────────────┘
10:00:23 AM: ​
10:00:23 AM: ❯ Version
10:00:23 AM:   @netlify/build 2.0.10
10:00:23 AM: ​
10:00:23 AM: ❯ Flags
10:00:23 AM:   deployId: 5ef99f3ae9ddb30fae03ce22
10:00:23 AM:   mode: buildbot
10:00:23 AM: ​
10:00:23 AM: ❯ Current directory
10:00:23 AM:   /opt/build/repo
10:00:23 AM: ​
10:00:23 AM: ❯ Config file
10:00:23 AM:   /opt/build/repo/netlify.toml
10:00:23 AM: ​
10:00:23 AM: ❯ Context
10:00:23 AM:   production
10:00:24 AM: ​
10:00:24 AM: ┌────────────────────────────────────┐
10:00:24 AM: │ 1. build.command from netlify.toml │
10:00:24 AM: └────────────────────────────────────┘
10:00:24 AM: ​
10:00:24 AM: $ yarn rw db up --no-db-client --auto-approve && yarn rw build
10:00:24 AM: yarn run v1.17.0
10:00:24 AM: $ /opt/build/repo/node_modules/.bin/rw db up --no-db-client --auto-approve
10:00:25 AM: Migrate database up... [started]
10:00:26 AM: $ /opt/build/repo/node_modules/.bin/prisma migrate up --experimental --create-db --auto-approve
10:00:30 AM: 🏋️‍  migrate up
10:00:30 AM: All migrations are already applied
10:00:30 AM: Migrate database up... [completed]
10:00:30 AM: Done in 5.94s.
10:00:31 AM: yarn run v1.17.0
10:00:31 AM: $ /opt/build/repo/node_modules/.bin/rw build
10:00:32 AM: Generating the Prisma client... [started]
10:00:34 AM: Generating the Prisma client... [completed]
10:00:34 AM: [08:00:34] Building "api"... [started]
10:00:36 AM: [08:00:36] Building "api"... [completed]
10:00:36 AM: [08:00:36] Building "web"... [started]
10:01:40 AM: [08:01:40] Building "web"... [completed]
10:01:40 AM: Done in 69.41s.
10:01:40 AM: ​
10:01:40 AM: (build.command completed in 1m 15.8s)
10:01:40 AM: ​
10:01:40 AM: ┌────────────────────────────────────────────────────────────┐
10:01:40 AM: │ 2. onPostBuild command from @netlify/plugin-functions-core │
10:01:40 AM: └────────────────────────────────────────────────────────────┘
10:01:40 AM: ​
10:01:40 AM: Packaging Functions from api/dist/functions directory:
10:01:40 AM:  - graphql.js
10:02:02 AM: ​
10:02:02 AM: (@netlify/plugin-functions-core onPostBuild completed in 22.1s)
10:02:02 AM: ​
10:02:02 AM: ┌─────────────────────────────┐
10:02:02 AM: │   Netlify Build Complete    │
10:02:02 AM: └─────────────────────────────┘
10:02:02 AM: ​
10:02:02 AM: (Netlify Build completed in 1m 38.8s)
10:02:02 AM: Caching artifacts
10:02:02 AM: Started saving node modules
10:02:02 AM: Finished saving node modules
10:02:02 AM: Started saving build plugins
10:02:02 AM: Finished saving build plugins
10:02:02 AM: Started saving yarn cache
10:02:02 AM: Finished saving yarn cache
10:02:02 AM: Started saving pip cache
10:02:09 AM: Finished saving pip cache
10:02:09 AM: Started saving emacs cask dependencies
10:02:09 AM: Finished saving emacs cask dependencies
10:02:09 AM: Started saving maven dependencies
10:02:09 AM: Finished saving maven dependencies
10:02:09 AM: Started saving boot dependencies
10:02:09 AM: Finished saving boot dependencies
10:02:09 AM: Started saving go dependencies
10:02:11 AM: Finished saving go dependencies
10:02:14 AM: Build script success
10:02:14 AM: Starting to deploy site from 'web/dist'
10:02:15 AM: Creating deploy tree 
10:02:15 AM: Creating deploy upload records
10:02:15 AM: 2 new files to upload
10:02:15 AM: 1 new functions to upload
10:02:19 AM: Starting post processing
10:02:19 AM: Post processing done
10:02:19 AM: Site is live
10:03:59 AM: Finished processing build request in 5m7.146172134s

What am I missing?

1 Like

Can you try deleting the created _Migration table and deploying again? That’ll force Prisma to re-run the migrations from scratch and we might get more hints in the log output.

1 Like

@rob Done, results are the same as droping the entire schema :-\ only the _migration table is rebuilt, below the log, I chose a build with cache flush.

9:43:13 AM: Build ready to start
9:43:15 AM: build-image version: 9d79ad851d6eff3969322d6e5b1df3d597650c41
9:43:15 AM: build-image tag: v3.3.19
9:43:15 AM: buildbot version: 8e2e5a3a5212190d0490c1372e313994f9085345
9:43:15 AM: Fetching cached dependencies
9:43:16 AM: Starting to download cache of 254.3KB
9:43:16 AM: Finished downloading cache in 72.95628ms
9:43:16 AM: Starting to extract cache
9:43:16 AM: Failed to fetch cache, continuing with build
9:43:16 AM: Starting to prepare the repo for build
9:43:16 AM: No cached dependencies found. Cloning fresh repo
9:43:16 AM: git clone git@bitbucket.org:noire_munich/afterreading
9:43:30 AM: Preparing Git Reference refs/heads/main
9:43:32 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn rw db up --no-db-client --auto-approve && yarn rw build' versus 'yarn rw db up --no-db-client && yarn rw build' in the Netlify UI
9:43:32 AM: Starting build script
9:43:32 AM: Installing dependencies
9:43:32 AM: Python version set to 2.7
9:43:32 AM: Attempting node version 'lts/*' from .nvmrc
9:43:32 AM: Downloading and installing node v12.18.1...
9:43:33 AM: Downloading https://nodejs.org/dist/v12.18.1/node-v12.18.1-linux-x64.tar.xz...
9:43:33 AM: Computing checksum with sha256sum
9:43:33 AM: Checksums matched!
9:43:35 AM: Now using node v12.18.1 (npm v6.14.5)
9:43:35 AM: Started restoring cached build plugins
9:43:35 AM: Finished restoring cached build plugins
9:43:36 AM: Attempting ruby version 2.6.2, read from environment
9:43:37 AM: Using ruby version 2.6.2
9:43:37 AM: Using PHP version 5.6
9:43:37 AM: 5.2 is already installed.
9:43:37 AM: Using Swift version 5.2
9:43:37 AM: Started restoring cached node modules
9:43:37 AM: Finished restoring cached node modules
9:43:37 AM: Started restoring cached yarn cache
9:43:37 AM: Finished restoring cached yarn cache
9:43:37 AM: Installing yarn at version 1.17.0
9:43:37 AM: Installing Yarn!
9:43:37 AM: > Downloading tarball...
9:43:37 AM: [1/2]: https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz --> /tmp/yarn.tar.gz.nc8U6sn7gy
9:43:37 AM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
9:43:37 AM:                                  Dload  Upload   Total   Spent    Left  Speed
9:43:37 AM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
9:43:37 AM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
9:43:37 AM: 100    80  100    80    0     0    307      0 --:--:-- --:--:-- --:--:--   307
9:43:38 AM: 100    93  100    93    0     0    166      0 --:--:-- --:--:-- --:--:--   166
9:43:38 AM: 100   630  100   630    0     0    658      0 --:--:-- --:--:-- --:--:--   658
9:43:39 AM:   0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
9:43:39 AM: 100 1213k  100 1213k    0     0   831k      0  0:00:01  0:00:01 --:--:-- 3952k
9:43:39 AM: [2/2]: https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz.asc --> /tmp/yarn.tar.gz.nc8U6sn7gy.asc
9:43:39 AM: 100    84  100    84    0     0   3069      0 --:--:-- --:--:-- --:--:--  3069
9:43:39 AM: 100    97  100    97    0     0   1764      0 --:--:-- --:--:-- --:--:--  1764
9:43:39 AM: 100   634  100   634    0     0   3464      0 --:--:-- --:--:-- --:--:--  3464
9:43:39 AM: 100   832  100   832    0     0   3302      0 --:--:-- --:--:-- --:--:--  3302
9:43:39 AM: > Verifying integrity...
9:43:39 AM: gpg: Signature made Fri 14 Jun 2019 06:55:58 PM UTC using RSA key ID 69475BAA
9:43:39 AM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
9:43:39 AM: gpg: WARNING: This key is not certified with a trusted signature!
9:43:39 AM: gpg:          There is no indication that the signature belongs to the owner.
9:43:39 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
9:43:39 AM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
9:43:39 AM: > GPG signature looks good
9:43:39 AM: > Extracting to ~/.yarn...
9:43:39 AM: > Adding to $PATH...
9:43:39 AM: > Successfully installed Yarn 1.17.0! Please open another terminal where the `yarn` command will now be available.
9:43:40 AM: Installing NPM modules using Yarn version 1.17.0
9:43:40 AM: yarn install v1.17.0
9:43:40 AM: [1/5] Validating package.json...
9:43:40 AM: [2/5] Resolving packages...
9:43:42 AM: [3/5] Fetching packages...
9:44:19 AM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
9:44:19 AM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
9:44:19 AM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
9:44:19 AM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
9:44:19 AM: [4/5] Linking dependencies...
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing@0.12.0" has unmet peer dependency "@redwoodjs/router@*".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing@0.12.0" has unmet peer dependency "react@*".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web@0.12.0" has unmet peer dependency "prop-types@*".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web@0.12.0" has unmet peer dependency "react@*".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing > @testing-library/react@10.3.0" has unmet peer dependency "react@*".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing > @testing-library/react@10.3.0" has unmet peer dependency "react-dom@*".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > @apollo/react-components@3.1.5" has unmet peer dependency "@types/react@^16.8.0".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-cache@^1.3.2".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-client@^2.6.4".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-link@^1.2.12".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-utilities@^1.3.2".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > @apollo/react-components@3.1.5" has unmet peer dependency "graphql@^14.3.1".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > @apollo/react-components@3.1.5" has unmet peer dependency "react@^16.8.0".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > @apollo/react-components@3.1.5" has unmet peer dependency "react-dom@^16.8.0".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-hooks@3.1.5" has unmet peer dependency "react@^16.8.0".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-hooks@3.1.5" has unmet peer dependency "react-dom@^16.8.0".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > react-hook-form@5.7.2" has unmet peer dependency "react@^16.8.0".
9:44:19 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-components > @apollo/react-common@3.1.4" has unmet peer dependency "react@^16.8.0".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > web > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > api > firebase-admin > @firebase/database > @firebase/auth-interop-types@0.1.5" has unmet peer dependency "@firebase/app-types@0.x".
9:44:19 AM: warning "workspace-aggregator-c8b6eeae-5c65-4775-aa86-6799c6e89e67 > web > firebase > @firebase/firestore > @grpc/grpc-js@1.1.0" has unmet peer dependency "google-auth-library@5.x || 6.x".
9:44:41 AM: [5/5] Building fresh packages...
9:44:49 AM: success Saved lockfile.
9:44:49 AM: Done in 69.02s.
9:44:49 AM: NPM modules installed using Yarn
9:44:49 AM: Started restoring cached go cache
9:44:49 AM: Finished restoring cached go cache
9:44:49 AM: Installing Go version 1.12
9:44:55 AM: unset GOOS;
9:44:55 AM: unset GOARCH;
9:44:55 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
9:44:55 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
9:44:55 AM: go version >&2;
9:44:55 AM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
9:44:55 AM: go version go1.12 linux/amd64
9:44:55 AM: Installing missing commands
9:44:55 AM: Verify run directory
9:44:56 AM: ​
9:44:56 AM: ┌─────────────────────────────┐
9:44:56 AM: │        Netlify Build        │
9:44:56 AM: └─────────────────────────────┘
9:44:56 AM: ​
9:44:56 AM: ❯ Version
9:44:56 AM:   @netlify/build 2.0.20
9:44:56 AM: ​
9:44:56 AM: ❯ Flags
9:44:56 AM:   deployId: 5efaed111da4620ed447b9aa
9:44:56 AM:   mode: buildbot
9:44:56 AM: ​
9:44:56 AM: ❯ Current directory
9:44:56 AM:   /opt/build/repo
9:44:56 AM: ​
9:44:56 AM: ❯ Config file
9:44:56 AM:   /opt/build/repo/netlify.toml
9:44:56 AM: ​
9:44:56 AM: ❯ Context
9:44:56 AM:   production
9:44:57 AM: ​
9:44:57 AM: ┌────────────────────────────────────┐
9:44:57 AM: │ 1. build.command from netlify.toml │
9:44:57 AM: └────────────────────────────────────┘
9:44:57 AM: ​
9:44:57 AM: $ yarn rw db up --no-db-client --auto-approve && yarn rw build
9:44:57 AM: yarn run v1.17.0
9:44:57 AM: $ /opt/build/repo/node_modules/.bin/rw db up --no-db-client --auto-approve
9:44:58 AM: Migrate database up... [started]
9:44:59 AM: $ /opt/build/repo/node_modules/.bin/prisma migrate up --experimental --create-db --auto-approve
9:45:03 AM: 🏋️‍  migrate up
9:45:03 AM: All migrations are already applied
9:45:03 AM: Migrate database up... [completed]
9:45:03 AM: Done in 5.76s.
9:45:03 AM: yarn run v1.17.0
9:45:03 AM: $ /opt/build/repo/node_modules/.bin/rw build
9:45:04 AM: Generating the Prisma client... [started]
9:45:07 AM: Generating the Prisma client... [completed]
9:45:07 AM: [07:45:07] Building "api"... [started]
9:45:09 AM: [07:45:09] Building "api"... [completed]
9:45:09 AM: [07:45:09] Building "web"... [started]
9:46:10 AM: [07:46:10] Building "web"... [completed]
9:46:10 AM: Done in 67.07s.
9:46:10 AM: ​
9:46:10 AM: (build.command completed in 1m 13.3s)
9:46:10 AM: ​
9:46:10 AM: ┌────────────────────────────────────────────────────────────┐
9:46:10 AM: │ 2. onPostBuild command from @netlify/plugin-functions-core │
9:46:10 AM: └────────────────────────────────────────────────────────────┘
9:46:10 AM: ​
9:46:10 AM: Packaging Functions from api/dist/functions directory:
9:46:10 AM:  - graphql.js
9:46:32 AM: ​
9:46:32 AM: (@netlify/plugin-functions-core onPostBuild completed in 21.3s)
9:46:32 AM: ​
9:46:32 AM: ┌─────────────────────────────┐
9:46:32 AM: │   Netlify Build Complete    │
9:46:32 AM: └─────────────────────────────┘
9:46:32 AM: ​
9:46:32 AM: (Netlify Build completed in 1m 36.2s)
9:46:32 AM: Caching artifacts
9:46:32 AM: Started saving node modules
9:46:32 AM: Finished saving node modules
9:46:32 AM: Started saving build plugins
9:46:32 AM: Finished saving build plugins
9:46:32 AM: Started saving yarn cache
9:46:32 AM: Finished saving yarn cache
9:46:32 AM: Started saving pip cache
9:46:32 AM: Finished saving pip cache
9:46:32 AM: Started saving emacs cask dependencies
9:46:32 AM: Finished saving emacs cask dependencies
9:46:32 AM: Started saving maven dependencies
9:46:32 AM: Finished saving maven dependencies
9:46:32 AM: Started saving boot dependencies
9:46:32 AM: Finished saving boot dependencies
9:46:32 AM: Started saving go dependencies
9:46:34 AM: Finished saving go dependencies
9:46:37 AM: Build script success
9:46:37 AM: Starting to deploy site from 'web/dist'
9:46:38 AM: Creating deploy tree 
9:46:38 AM: Creating deploy upload records
9:46:38 AM: 2 new files to upload
9:46:38 AM: 1 new functions to upload
9:46:43 AM: Starting post processing
9:46:44 AM: Post processing done
9:46:44 AM: Site is live
9:47:59 AM: Finished processing build request in 4m43.86348559s

@noire.munich - Can you please post your schema or a link to your repo?

@noire.munich - Can you also please make sure your netlify.toml has the [[plugins]] section:

[[plugins]]
package = 'netlify-plugin-prisma-provider'
  [plugins.inputs]
  path = 'api/prisma/schema.prisma'

@Terris netlify.toml was incomplete indeed - I don’t know why, must have missed it in an update.
It did not fix the issue though, so below is my schema.
Also I’m on MySQL, should it matter.

datasource DS {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

generator client {
  provider      = "prisma-client-js"
  binaryTargets = env("BINARY_TARGET")
}

// Define your own datamodels here and run `yarn redwood db save` to create
// migrations for them.

model Book {
  id String @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime?
  title String
  subtitle String?
  covers String?
  isbn String? @unique
  metaData String?
  localisations Localisation[]
  authors Author[] @relation(references: [id])
  ownerships Ownership[]
}

model Author {
  id String @id @default(cuid())
  name String @unique
  books Book[] @relation(references: [id])
}

model Category {
  id String @id @default(cuid())
  name String @unique
  books Book[]
}

model Publisher {
  id String @id @default(cuid())
  name String @unique
  books Book[]
}

model User {
  id String @id @default(cuid())
  uid String? @unique
  createdAt DateTime @default(now())
  updatedAt DateTime?
  handle String @unique
  email String @unique
  lastname String?
  firstname String?
  createdByTier Boolean @default(false)
  tokens Token[]
  configuration String?
  ownerships Ownership[]
  localisations Localisation[]
  contacts User[] @relation("Contact", references: [id])
  contactOf User[] @relation("Contact", references: [id])
}

model Token {
  id String @id @default(cuid())
  token String @unique
  createdAt DateTime @default(now())
  updatedAt DateTime?
}


model Label {
  id String @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime?
  name String
  user User @relation(fields: [userId], references: [id])
  userId String
  ownerships Ownership[] @relation(references: [id])

  @@unique([userId,name], name: "LabelOfUser")
}

model Loan {
  id String @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime?
  beginAt DateTime @default(now())
  endAt DateTime?
  user User @relation(fields: [userId], references: [id])
  userId String
  ownerships Ownership[]
}

model Localisation {
  id String @id @default(cuid())
  name String
  address String
}

model Ownership {
  id String @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime?
  rate Int?
  note String?
  book Book @relation(fields: [bookId], references: [id])
  bookId String
  labels Label[] @relation(references: [id])
  loanedIn Loan? @relation(fields: [loanId], references: [id])
  loanId String?
  user User @relation(fields: [userId], references: [id])
  userId String

  @@unique([bookId, userId], name: "BookOfUser")
}

@noire.munich - Hmm, interesting!! Can you tell me which version of MySQL you are running? Perhaps it’s one that isn’t supported: https://www.prisma.io/docs/more/supported-databases

I’m going to try to fire up a deploy with your schema and see what happens…

Have you created any migrations with yarn rw db save? That log output doesn’t show any migrations running, which seems to me like you don’t have any? Or they haven’t been checked into the repo? What’s in your api/prisma/migrations folder?

@Terris on dev it should work - I have no such issue on my side, it only happens on production. Mysql version is 5.7.26 - shipped with JAWSMysql on Heroku, I don’t think that’s controllable in this context but at least it’s a supported version according to prisma.

@rob very good point, I had no migrations, I assume I lost them in my experimentations of last week. I fixed them but the build got stuck, so I blamed my seeds.js because it is broken. On dev it’s ok but on prod I believe it stops the build entirely, I cannot verify it though because the log simply stops outputting anything ( see below ).
Also I renamed my seeds.js to something else - which is dirty and shameful but as of today I do not know how I can fix it thanks to Redwood ( different topic ). The build still fails despite of it.
Anyway, my tables are now populated but the build fails with no given reason ( after something like 20 minutes of idle state ):

9:26:25 AM: Build ready to start
9:26:26 AM: build-image version: 9d79ad851d6eff3969322d6e5b1df3d597650c41
9:26:26 AM: build-image tag: v3.3.19
9:26:26 AM: buildbot version: 8e2e5a3a5212190d0490c1372e313994f9085345
9:26:27 AM: Fetching cached dependencies
9:26:27 AM: Starting to download cache of 451.3MB
9:26:29 AM: Finished downloading cache in 1.980174585s
9:26:29 AM: Starting to extract cache
9:26:51 AM: Finished extracting cache in 22.02011085s
9:26:51 AM: Finished fetching cache in 24.096941592s
9:26:51 AM: Starting to prepare the repo for build
9:26:51 AM: Preparing Git Reference refs/heads/main
9:26:55 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn rw db up --no-db-client --auto-approve && yarn rw build' versus 'yarn rw db up --no-db-client && yarn rw build' in the Netlify UI
9:26:55 AM: Starting build script
9:26:55 AM: Installing dependencies
9:26:55 AM: Python version set to 2.7
9:26:56 AM: Started restoring cached node version
9:27:00 AM: Finished restoring cached node version
9:27:00 AM: Attempting node version 'lts/*' from .nvmrc
9:27:00 AM: v12.18.2 is already installed.
9:27:01 AM: Now using node v12.18.2 (npm v6.14.5)
9:27:01 AM: Started restoring cached build plugins
9:27:01 AM: Finished restoring cached build plugins
9:27:01 AM: Attempting ruby version 2.6.2, read from environment
9:27:02 AM: Using ruby version 2.6.2
9:27:03 AM: Using PHP version 5.6
9:27:03 AM: 5.2 is already installed.
9:27:03 AM: Using Swift version 5.2
9:27:03 AM: Started restoring cached node modules
9:27:03 AM: Finished restoring cached node modules
9:27:03 AM: Started restoring cached yarn cache
9:27:03 AM: Finished restoring cached yarn cache
9:27:03 AM: Installing NPM modules using Yarn version 1.17.0
9:27:04 AM: yarn install v1.17.0
9:27:04 AM: [1/5] Validating package.json...
9:27:04 AM: [2/5] Resolving packages...
9:27:05 AM: [3/5] Fetching packages...
9:27:52 AM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
9:27:52 AM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
9:27:52 AM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
9:27:52 AM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
9:27:52 AM: [4/5] Linking dependencies...
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing@0.12.1-canary.10" has unmet peer dependency "@redwoodjs/router@*".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing@0.12.1-canary.10" has unmet peer dependency "react@*".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web@0.12.1-canary.10" has unmet peer dependency "prop-types@*".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web@0.12.1-canary.10" has unmet peer dependency "react@*".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing > @testing-library/react@10.3.0" has unmet peer dependency "react@*".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing > @testing-library/react@10.3.0" has unmet peer dependency "react-dom@*".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > @apollo/react-components@3.1.5" has unmet peer dependency "@types/react@^16.8.0".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-cache@^1.3.2".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-client@^2.6.4".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-link@^1.2.12".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-utilities@^1.3.2".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > @apollo/react-components@3.1.5" has unmet peer dependency "graphql@^14.3.1".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > @apollo/react-components@3.1.5" has unmet peer dependency "react@^16.8.0".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > @apollo/react-components@3.1.5" has unmet peer dependency "react-dom@^16.8.0".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-hooks@3.1.5" has unmet peer dependency "react@^16.8.0".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-hooks@3.1.5" has unmet peer dependency "react-dom@^16.8.0".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > react-hook-form@5.7.2" has unmet peer dependency "react@^16.8.0".
9:27:52 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-components > @apollo/react-common@3.1.4" has unmet peer dependency "react@^16.8.0".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > web > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > api > firebase-admin > @firebase/database > @firebase/auth-interop-types@0.1.5" has unmet peer dependency "@firebase/app-types@0.x".
9:27:52 AM: warning "workspace-aggregator-80d36b60-4858-4cff-a305-9851fe6dca9f > web > firebase > @firebase/firestore > @grpc/grpc-js@1.1.0" has unmet peer dependency "google-auth-library@5.x || 6.x".
9:28:25 AM: [5/5] Building fresh packages...
9:28:31 AM: Done in 86.95s.
9:28:31 AM: NPM modules installed using Yarn
9:28:31 AM: Started restoring cached go cache
9:28:33 AM: Finished restoring cached go cache
9:28:33 AM: Installing Go version 1.12
9:28:33 AM: unset GOOS;
9:28:33 AM: unset GOARCH;
9:28:33 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
9:28:33 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
9:28:33 AM: go version >&2;
9:28:33 AM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env';
9:28:33 AM: go version go1.12 linux/amd64
9:28:33 AM: Installing missing commands
9:28:33 AM: Verify run directory
9:28:34 AM: ​
9:28:34 AM: ┌─────────────────────────────┐
9:28:34 AM: │        Netlify Build        │
9:28:34 AM: └─────────────────────────────┘
9:28:34 AM: ​
9:28:34 AM: ❯ Version
9:28:34 AM:   @netlify/build 2.0.20
9:28:34 AM: ​
9:28:34 AM: ❯ Flags
9:28:34 AM:   deployId: 5efc3aa1d3d34c000716590e
9:28:34 AM:   mode: buildbot
9:28:34 AM: ​
9:28:34 AM: ❯ Current directory
9:28:34 AM:   /opt/build/repo
9:28:34 AM: ​
9:28:34 AM: ❯ Config file
9:28:34 AM:   /opt/build/repo/netlify.toml
9:28:34 AM: ​
9:28:34 AM: ❯ Context
9:28:34 AM:   production
9:28:34 AM: ​
9:28:34 AM: ❯ Loading plugins
9:28:34 AM:    - netlify-plugin-prisma-provider@0.3.0 from netlify.toml
9:28:35 AM: ​
9:28:35 AM: ┌───────────────────────────────────────────────────────────┐
9:28:35 AM: │ 1. onPreBuild command from netlify-plugin-prisma-provider │
9:28:35 AM: └───────────────────────────────────────────────────────────┘
9:28:35 AM: ​
9:28:35 AM: Replacing provider in schema.prisma...
9:28:35 AM:   Skipping, provider is not "sqlite" in api/prisma/schema.prisma
9:28:35 AM: Replacing providers in migrations schema.prisma...
9:28:35 AM:   Skipping, provider is not "sqlite" in api/prisma/migrations/20200701075337/schema.prisma
9:28:35 AM: Replacing providers in migrations steps.json...
9:28:35 AM:   Skipping, provider is not "sqlite" in api/prisma/migrations/20200701075337/steps.json
9:28:35 AM: ​
9:28:35 AM: (netlify-plugin-prisma-provider onPreBuild completed in 16ms)
9:28:35 AM: ​
9:28:35 AM: ┌────────────────────────────────────┐
9:28:35 AM: │ 2. build.command from netlify.toml │
9:28:35 AM: └────────────────────────────────────┘
9:28:35 AM: ​
9:28:35 AM: $ yarn rw db up --no-db-client --auto-approve && yarn rw build
9:28:36 AM: yarn run v1.17.0
9:28:36 AM: $ /opt/build/repo/node_modules/.bin/rw db up --no-db-client --auto-approve
9:28:37 AM: Migrate database up... [started]
9:28:37 AM: $ /opt/build/repo/node_modules/.bin/prisma migrate up --experimental --create-db --auto-approve
9:28:41 AM: 🏋️‍  migrate up
9:28:41 AM: Datamodel that will initialize the db:
9:28:41 AM: 
9:28:41 AM: datasource DS {
9:28:41 AM:   provider = "mysql"
9:28:41 AM:   url = "***"
9:28:41 AM: }
9:28:41 AM: generator client {
9:28:41 AM:   provider      = "prisma-client-js"
9:28:41 AM:   binaryTargets = env("BINARY_TARGET")
9:28:41 AM: }
9:28:41 AM: // Define your own datamodels here and run `yarn redwood db save` to create
9:28:41 AM: // migrations for them.
9:28:41 AM: model Book {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   createdAt DateTime @default(now())
9:28:41 AM:   updatedAt DateTime?
9:28:41 AM:   title String
9:28:41 AM:   subtitle String?
9:28:41 AM:   covers String?
9:28:41 AM:   isbn String? @unique
9:28:41 AM:   metaData String?
9:28:41 AM:   localisations Localisation[]
9:28:41 AM:   authors Author[] @relation(references: [id])
9:28:41 AM:   ownerships Ownership[]
9:28:41 AM: }
9:28:41 AM: model Author {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   name String @unique
9:28:41 AM:   books Book[] @relation(references: [id])
9:28:41 AM: }
9:28:41 AM: model Category {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   name String @unique
9:28:41 AM:   books Book[]
9:28:41 AM: }
9:28:41 AM: model Publisher {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   name String @unique
9:28:41 AM:   books Book[]
9:28:41 AM: }
9:28:41 AM: model User {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   uid String? @unique
9:28:41 AM:   createdAt DateTime @default(now())
9:28:41 AM:   updatedAt DateTime?
9:28:41 AM:   handle String @unique
9:28:41 AM:   email String @unique
9:28:41 AM:   lastname String?
9:28:41 AM:   firstname String?
9:28:41 AM:   createdByTier Boolean @default(false)
9:28:41 AM:   tokens Token[]
9:28:41 AM:   configuration String?
9:28:41 AM:   ownerships Ownership[]
9:28:41 AM:   localisations Localisation[]
9:28:41 AM:   contacts User[] @relation("Contact", references: [id])
9:28:41 AM:   contactOf User[] @relation("Contact", references: [id])
9:28:41 AM: }
9:28:41 AM: model Token {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   token String @unique
9:28:41 AM:   createdAt DateTime @default(now())
9:28:41 AM:   updatedAt DateTime?
9:28:41 AM: }
9:28:41 AM: model Label {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   createdAt DateTime @default(now())
9:28:41 AM:   updatedAt DateTime?
9:28:41 AM:   name String
9:28:41 AM:   user User @relation(fields: [userId], references: [id])
9:28:41 AM:   userId String
9:28:41 AM:   ownerships Ownership[] @relation(references: [id])
9:28:41 AM:   @@unique([userId,name], name: "LabelOfUser")
9:28:41 AM: }
9:28:41 AM: model Loan {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   createdAt DateTime @default(now())
9:28:41 AM:   updatedAt DateTime?
9:28:41 AM:   beginAt DateTime @default(now())
9:28:41 AM:   endAt DateTime?
9:28:41 AM:   user User @relation(fields: [userId], references: [id])
9:28:41 AM:   userId String
9:28:41 AM:   ownerships Ownership[]
9:28:41 AM: }
9:28:41 AM: model Localisation {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   name String
9:28:41 AM:   address String
9:28:41 AM: }
9:28:41 AM: model Ownership {
9:28:41 AM:   id String @id @default(cuid())
9:28:41 AM:   createdAt DateTime @default(now())
9:28:41 AM:   updatedAt DateTime?
9:28:41 AM:   rate Int?
9:28:41 AM:   note String?
9:28:41 AM:   book Book @relation(fields: [bookId], references: [id])
9:28:41 AM:   bookId String
9:28:41 AM:   labels Label[] @relation(references: [id])
9:28:41 AM:   loanedIn Loan? @relation(fields: [loanId], references: [id])
9:28:41 AM:   loanId String?
9:28:41 AM:   user User @relation(fields: [userId], references: [id])
9:28:41 AM:   userId String
9:28:41 AM:   @@unique([bookId, userId], name: "BookOfUser")
9:28:41 AM: }
9:28:41 AM: Checking the datasource for potential data loss...
9:28:45 AM: 
9:28:45 AM: Database Changes:
9:28:45 AM: 
9:28:45 AM: Migration       Database actionsStatus
9:28:45 AM: 20200701075337   statements.  
9:28:45 AM: 
9:28:45 AM: You can get the detailed db changes with prisma migrate up --experimental --verb
9:28:45 AM: ose
9:28:45 AM: Or read about them in the ./migrations/MIGRATION_ID/README.md

So the seeds file doesn’t run in production by default. If you need to run them against the production database you’d either need to point your development environment to your production database, or add the yarn rw db seed command to your list of build commands in netlify.toml.

Even though the process is hung, is the database migrated correctly? Or do you still end up with only the _Migration table?

How did you restore the missing migrations? Did you pull them out of git or did you re-create them? We’ve seen issues when Prisma has had new releases where previous migration files generated in beta1 weren’t compatible with beta3, for example. If those migrations were created in previous beta versions of Prisma you may want to delete the migrations directory completely and yarn rw db save to create them from scratch (you’ll end up with 1 large migration that creates all of the tables).

1 Like

seeds.js: Ok, I’ll keep that in mind, I had one mostly to keep the db populated through schema changes as I was building it up, today it really is not very relevant ( no global config needed for instance ) so I can spare it.

Schema population: I have all my tables and they seem to be properly built, but the process still hangs :-\ .

Migrations: I recreated the migrations using the redwood commands db save & db up, added them to git and pushed it all, these created the schema.
For the sake of it I recreated my entire local schema using the same migrations used on prod, it seems to be working fine.
If relevant it’s an “old” install: I began the project with v0.2.0 ( if not v0.1.0 ), I had a couple of bumps upgrading until v0.6.0, I’ve tried to also keep up with breaking changes… It’s possible I’d have missed something about production deploys, would that make sense?

I don’t remember anything really related to deploys that would have broken between releases…we added that netlify plugin to handle swapping out the DB provider between sqlite and postgres/mysql, but I saw from your logs that you do have that plugin but it doesn’t get used because you have “mysql” in your schema.prisma already.

We required the Netlify Build Beta process to deploy for a while, but that’s in general release now and I can see from the logs it’s getting used properly.

I did see a couple of days ago either an Issue or a thread here where the prisma command line tools will try to show a prompt to upgrade to the latest version, and that prompt will cause one of the commands to hang (yarn rw dev might have been mentioned in the issue). It could be that? You’re on Redwood 0.12.0 correct? Can you do a yarn workspace api prisma --version and let us know what it returns? There’s was a workaround in that issue/thread, you need to pass a flag to prisma to not show the upgrade prompt.

There is a new version of Prisma out that we don’t have in Redwood yet, 2.1.3… could be that!

There’s this one, which would warn you about data loss, but that shouldn’t be coming up with a brand new database install: https://github.com/redwoodjs/redwood/pull/661

Here it is! Thanks to @dom for the find assist!

1 Like

Ok so, I executed the command:
@prisma/cli : 2.1.1

I added the flag in netlify.toml:

[build]
  command = "yarn cross-env PRISMA_HIDE_UPDATE_MESSAGE='1' && yarn rw db up --no-db-client --auto-approve && yarn rw build"

It is still hanging though, the flag is executed but the problem is not solved, here is the log:

8:10:20 AM: Build ready to start
8:10:22 AM: build-image version: 9d79ad851d6eff3969322d6e5b1df3d597650c41
8:10:22 AM: build-image tag: v3.3.19
8:10:22 AM: buildbot version: 2cc7ea668a3e8f63326d15aab17e62cd1997fa2e
8:10:22 AM: Fetching cached dependencies
8:10:22 AM: Starting to download cache of 451.3MB
8:10:26 AM: Finished downloading cache in 3.871837686s
8:10:26 AM: Starting to extract cache
8:10:44 AM: Finished extracting cache in 17.990132163s
8:10:44 AM: Finished fetching cache in 21.95754848s
8:10:44 AM: Starting to prepare the repo for build
8:10:44 AM: Preparing Git Reference refs/heads/main
8:10:51 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn cross-env PRISMA_HIDE_UPDATE_MESSAGE='1' && yarn rw db up --no-db-client --auto-approve && yarn rw build' versus 'yarn rw db up --no-db-client && yarn rw build' in the Netlify UI
8:10:51 AM: Starting build script
8:10:51 AM: Installing dependencies
8:10:51 AM: Python version set to 2.7
8:10:52 AM: Started restoring cached node version
8:10:55 AM: Finished restoring cached node version
8:10:55 AM: Attempting node version 'lts/*' from .nvmrc
8:10:55 AM: v12.18.2 is already installed.
8:10:55 AM: Now using node v12.18.2 (npm v6.14.5)
8:10:56 AM: Started restoring cached build plugins
8:10:56 AM: Finished restoring cached build plugins
8:10:56 AM: Attempting ruby version 2.6.2, read from environment
8:10:57 AM: Using ruby version 2.6.2
8:10:57 AM: Using PHP version 5.6
8:10:57 AM: 5.2 is already installed.
8:10:57 AM: Using Swift version 5.2
8:10:57 AM: Started restoring cached node modules
8:10:57 AM: Finished restoring cached node modules
8:10:57 AM: Started restoring cached yarn cache
8:10:57 AM: Finished restoring cached yarn cache
8:10:58 AM: Installing NPM modules using Yarn version 1.17.0
8:10:58 AM: yarn install v1.17.0
8:10:58 AM: [1/5] Validating package.json...
8:10:58 AM: [2/5] Resolving packages...
8:10:59 AM: [3/5] Fetching packages...
8:11:36 AM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
8:11:36 AM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
8:11:36 AM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
8:11:36 AM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
8:11:36 AM: [4/5] Linking dependencies...
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing@0.12.1-canary.10" has unmet peer dependency "@redwoodjs/router@*".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing@0.12.1-canary.10" has unmet peer dependency "react@*".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web@0.12.1-canary.10" has unmet peer dependency "prop-types@*".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web@0.12.1-canary.10" has unmet peer dependency "react@*".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing > @testing-library/react@10.3.0" has unmet peer dependency "react@*".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing > @testing-library/react@10.3.0" has unmet peer dependency "react-dom@*".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > @apollo/react-components@3.1.5" has unmet peer dependency "@types/react@^16.8.0".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-cache@^1.3.2".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-client@^2.6.4".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-link@^1.2.12".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > @apollo/react-components@3.1.5" has unmet peer dependency "apollo-utilities@^1.3.2".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > @apollo/react-components@3.1.5" has unmet peer dependency "graphql@^14.3.1".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > @apollo/react-components@3.1.5" has unmet peer dependency "react@^16.8.0".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > @apollo/react-components@3.1.5" has unmet peer dependency "react-dom@^16.8.0".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-hooks@3.1.5" has unmet peer dependency "react@^16.8.0".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-hooks@3.1.5" has unmet peer dependency "react-dom@^16.8.0".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > react-hook-form@5.7.2" has unmet peer dependency "react@^16.8.0".
8:11:36 AM: warning "@redwoodjs/core > @redwoodjs/testing > @redwoodjs/web > @apollo/react-components > @apollo/react-common@3.1.4" has unmet peer dependency "react@^16.8.0".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > web > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > api > firebase-admin > @firebase/database > @firebase/auth-interop-types@0.1.5" has unmet peer dependency "@firebase/app-types@0.x".
8:11:36 AM: warning "workspace-aggregator-1b5c02ab-9ea9-4434-b187-b5d7b20cbf36 > web > firebase > @firebase/firestore > @grpc/grpc-js@1.1.0" has unmet peer dependency "google-auth-library@5.x || 6.x".
8:12:08 AM: [5/5] Building fresh packages...
8:12:14 AM: Done in 76.05s.
8:12:14 AM: NPM modules installed using Yarn
8:12:14 AM: Started restoring cached go cache
8:12:16 AM: Finished restoring cached go cache
8:12:16 AM: Installing Go version 1.12
8:12:16 AM: unset GOOS;
8:12:16 AM: unset GOARCH;
8:12:16 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
8:12:16 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
8:12:16 AM: go version >&2;
8:12:16 AM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env';
8:12:16 AM: go version go1.12 linux/amd64
8:12:16 AM: Installing missing commands
8:12:16 AM: Verify run directory
8:12:17 AM: ​
8:12:17 AM: ┌─────────────────────────────┐
8:12:17 AM: │        Netlify Build        │
8:12:17 AM: └─────────────────────────────┘
8:12:17 AM: ​
8:12:17 AM: ❯ Version
8:12:17 AM:   @netlify/build 2.0.25
8:12:17 AM: ​
8:12:17 AM: ❯ Flags
8:12:17 AM:   deployId: 5efd7a4caa5b7c0007626345
8:12:17 AM:   mode: buildbot
8:12:17 AM: ​
8:12:17 AM: ❯ Current directory
8:12:17 AM:   /opt/build/repo
8:12:17 AM: ​
8:12:17 AM: ❯ Config file
8:12:17 AM:   /opt/build/repo/netlify.toml
8:12:17 AM: ​
8:12:17 AM: ❯ Context
8:12:17 AM:   production
8:12:17 AM: ​
8:12:17 AM: ❯ Loading plugins
8:12:17 AM:    - netlify-plugin-prisma-provider@0.3.0 from netlify.toml
8:12:18 AM: ​
8:12:18 AM: ┌───────────────────────────────────────────────────────────┐
8:12:18 AM: │ 1. onPreBuild command from netlify-plugin-prisma-provider │
8:12:18 AM: └───────────────────────────────────────────────────────────┘
8:12:18 AM: ​
8:12:18 AM: Replacing provider in schema.prisma...
8:12:18 AM:   Skipping, provider is not "sqlite" in api/prisma/schema.prisma
8:12:18 AM: Replacing providers in migrations schema.prisma...
8:12:18 AM:   Skipping, provider is not "sqlite" in api/prisma/migrations/20200701075337/schema.prisma
8:12:18 AM: Replacing providers in migrations steps.json...
8:12:18 AM:   Skipping, provider is not "sqlite" in api/prisma/migrations/20200701075337/steps.json
8:12:18 AM: ​
8:12:18 AM: (netlify-plugin-prisma-provider onPreBuild completed in 14ms)
8:12:18 AM: ​
8:12:18 AM: ┌────────────────────────────────────┐
8:12:18 AM: │ 2. build.command from netlify.toml │
8:12:18 AM: └────────────────────────────────────┘
8:12:18 AM: ​
8:12:18 AM: $ yarn cross-env PRISMA_HIDE_UPDATE_MESSAGE='1' && yarn rw db up --no-db-client --auto-approve && yarn rw build
8:12:19 AM: yarn run v1.17.0
8:12:19 AM: $ /opt/build/repo/node_modules/.bin/cross-env PRISMA_HIDE_UPDATE_MESSAGE=1
8:12:19 AM: Done in 0.12s.
8:12:19 AM: yarn run v1.17.0
8:12:19 AM: $ /opt/build/repo/node_modules/.bin/rw db up --no-db-client --auto-approve
8:12:20 AM: Migrate database up... [started]
8:12:20 AM: $ /opt/build/repo/node_modules/.bin/prisma migrate up --experimental --create-db --auto-approve
8:12:26 AM: 🏋️‍  migrate up
8:12:26 AM: Datamodel that will initialize the db:
8:12:26 AM: 
8:12:26 AM: datasource DS {
8:12:26 AM:   provider = "mysql"
8:12:26 AM:   url = "***"
8:12:26 AM: }
8:12:26 AM: generator client {
8:12:26 AM:   provider      = "prisma-client-js"
8:12:26 AM:   binaryTargets = env("BINARY_TARGET")
8:12:26 AM: }
8:12:26 AM: // Define your own datamodels here and run `yarn redwood db save` to create
8:12:26 AM: // migrations for them.
8:12:26 AM: model Book {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   createdAt DateTime @default(now())
8:12:26 AM:   updatedAt DateTime?
8:12:26 AM:   title String
8:12:26 AM:   subtitle String?
8:12:26 AM:   covers String?
8:12:26 AM:   isbn String? @unique
8:12:26 AM:   metaData String?
8:12:26 AM:   localisations Localisation[]
8:12:26 AM:   authors Author[] @relation(references: [id])
8:12:26 AM:   ownerships Ownership[]
8:12:26 AM: }
8:12:26 AM: model Author {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   name String @unique
8:12:26 AM:   books Book[] @relation(references: [id])
8:12:26 AM: }
8:12:26 AM: model Category {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   name String @unique
8:12:26 AM:   books Book[]
8:12:26 AM: }
8:12:26 AM: model Publisher {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   name String @unique
8:12:26 AM:   books Book[]
8:12:26 AM: }
8:12:26 AM: model User {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   uid String? @unique
8:12:26 AM:   createdAt DateTime @default(now())
8:12:26 AM:   updatedAt DateTime?
8:12:26 AM:   handle String @unique
8:12:26 AM:   email String @unique
8:12:26 AM:   lastname String?
8:12:26 AM:   firstname String?
8:12:26 AM:   createdByTier Boolean @default(false)
8:12:26 AM:   tokens Token[]
8:12:26 AM:   configuration String?
8:12:26 AM:   ownerships Ownership[]
8:12:26 AM:   localisations Localisation[]
8:12:26 AM:   contacts User[] @relation("Contact", references: [id])
8:12:26 AM:   contactOf User[] @relation("Contact", references: [id])
8:12:26 AM: }
8:12:26 AM: model Token {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   token String @unique
8:12:26 AM:   createdAt DateTime @default(now())
8:12:26 AM:   updatedAt DateTime?
8:12:26 AM: }
8:12:26 AM: model Label {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   createdAt DateTime @default(now())
8:12:26 AM:   updatedAt DateTime?
8:12:26 AM:   name String
8:12:26 AM:   user User @relation(fields: [userId], references: [id])
8:12:26 AM:   userId String
8:12:26 AM:   ownerships Ownership[] @relation(references: [id])
8:12:26 AM:   @@unique([userId,name], name: "LabelOfUser")
8:12:26 AM: }
8:12:26 AM: model Loan {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   createdAt DateTime @default(now())
8:12:26 AM:   updatedAt DateTime?
8:12:26 AM:   beginAt DateTime @default(now())
8:12:26 AM:   endAt DateTime?
8:12:26 AM:   user User @relation(fields: [userId], references: [id])
8:12:26 AM:   userId String
8:12:26 AM:   ownerships Ownership[]
8:12:26 AM: }
8:12:26 AM: model Localisation {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   name String
8:12:26 AM:   address String
8:12:26 AM: }
8:12:26 AM: model Ownership {
8:12:26 AM:   id String @id @default(cuid())
8:12:26 AM:   createdAt DateTime @default(now())
8:12:26 AM:   updatedAt DateTime?
8:12:26 AM:   rate Int?
8:12:26 AM:   note String?
8:12:26 AM:   book Book @relation(fields: [bookId], references: [id])
8:12:26 AM:   bookId String
8:12:26 AM:   labels Label[] @relation(references: [id])
8:12:26 AM:   loanedIn Loan? @relation(fields: [loanId], references: [id])
8:12:26 AM:   loanId String?
8:12:26 AM:   user User @relation(fields: [userId], references: [id])
8:12:26 AM:   userId String
8:12:26 AM:   @@unique([bookId, userId], name: "BookOfUser")
8:12:26 AM: }
8:12:26 AM: Checking the datasource for potential data loss...
8:12:30 AM: 
8:12:30 AM: Database Changes:
8:12:30 AM: 
8:12:30 AM: Migration       Database actionsStatus
8:12:30 AM: 20200701075337   statements.  
8:12:30 AM: 
8:12:30 AM: You can get the detailed db changes with prisma migrate up --experimental --verb
8:12:30 AM: ose
8:12:30 AM: Or read about them in the ./migrations/MIGRATION_ID/README.md

I’d have put my money on it though, it was a good bet! I’ve seen the prompt you are talking about but it has not occurred in a couple of iterations.

1 Like

You may need to put that PRISMA_HIDE_UPDATE_MESSAGE=1 on the next command… do ENV vars stick around between commands when run with && between them?

Seeing that line says to me that Prisma thinks the migration hasn’t occurred yet and so is trying to run them from scratch again. But you said the tables are in the database at this point, correct? Is there anything in the _Migration table or is it empty? There should be a timestamp entry for every migration that has run against the database. It could be that the row isn’t being added to _Migration and so Prisma thinks no migrations have run yet and tries to run them again.

What would be hanging the process between creating the tables and inserting that row… no idea. :frowning:

According to the doc they do indeed, cross-env-shell is recommended if you’d need to actually use the variable in the following commands ( cross-env - npm ).

It also is possible to set up the env variable alongside the deploy variables - as long as it’s removed in due time, which would be using a process we already trust. I added it, to be sure x).

Ok we are narrowing it down to that moment, where the schema is being created and the row is inserted in the _migration table.
This morning I checked the schema and found the _migration table alongside its sisters, it had rows in it and apparently it had recorded errors ( about tables already existing ).
I dropped the schema and began a new deploy. All my tables are in there to the exception of the _migration table which is missing.

I have triggered a new deploy afterwards without removing the schema, it created and populated a _migration table with one error saying the tables already existed. Process is still dead at that same point.

Do we have anyone from the prisma team hanging around the community? In any case, I have opened an issue: RedwoodJS & Netlify deploy is failing during migration · prisma/prisma · Discussion #2927 · GitHub

Last question: do we have other projects deployed using a mysql db? I’m on netlify & heroku, I took the JAWSMysql plugin, which is not the one recommended in the tutorials as far as I remember. That would be a relief to hear about a fully tested & working deploy with these specifics :).

Good news!
Prisma actually throws a tantrum:

Failure during a migration command: Connector error. (error: Error querying the database: Error querying the database: S
erver error: `ERROR 42S02 (1146): Table 'c7xstd0q7435k9ek._migration' doesn't exist'
   0: migration_core::api::ApplyMigration
           with migration_id="20200701075337"
             at migration-engine/core/src/api.rs:77)

Which doesn’t appear at all in the deploy logs ( that I don’t know why ).

I’ve sent a report and following up on the github conversation.
On the RW side it would be nice if such things were not silenced. Is it any possible, or do we have specific reasons to block them?

1 Like