Skip to content

422 "No records matched" error when deploying #6403

@ali-kamalizade

Description

@ali-kamalizade

Describe the bug

I am adding multi-language support to one of our web apps. We use GitHub actions to deploy new versions. This has worked so far but since changing the structure of our app the deployment appears to fail rather often. The error logs mention a 422 unprocessable entity error.

The file structure in the file browser looks like this:

  • en (contains index.html and other files)
  • de (contains index.html and other files)
  • netlify.toml

But the deployment itself seems (?) to have worked as the changes seem to be available in production hence it might be something after the deployment that the Netlify CLI is attempting to do which causes our GitHub workflow to fail.

Error logs
✔ Finished uploading blobs to deploy store
- Hashing files...
- Looking for a functions cache...
✔ Deploying functions from cache (use --skip-functions-cache to override)
✔ Finished hashing 741 files and 4 functions
- CDN diffing files...
✔ CDN requesting 8 files and 0 functions
- Uploading 10 files
 ›   Warning: JSONHTTPError: No records matched 422
 ›   Warning: 
{
  "name": "JSONHTTPError",
  "status": 422,
  "json": {
    "code": 422,
    "message": "No records matched"
  }
}
​
Save updated config                                           
────────────────────────────────────────────────────────────────
​
(options.onEnd completed in 172ms)
​
Internal error during "options.onPostBuild"                   
────────────────────────────────────────────────────────────────
​
  Error message
  JSONHTTPError: Unprocessable Entity
​
  Error location
  During options.onPostBuild
      at parseResponse (file:///home/runner/work/web-app/web-app/node_modules/netlify-cli/node_modules/netlify/lib/methods/response.js:10:39)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async callMethod (file:///home/runner/work/web-app/web-app/node_modules/netlify-cli/node_modules/netlify/lib/methods/index.js:26:28)
      at async tryUpload (file:///home/runner/work/web-app/web-app/node_modules/netlify-cli/dist/utils/deploy/upload-files.js:80:29)

{
    name: 'JSONHTTPError',
    status: 422,
    json: { code: 422, message: 'No records matched' }
 }

Steps to reproduce

It is hard to reproduce reliably but here is my best guess:

  1. Change a lot of files
  2. Run the deployment command: npx netlify deploy --prod --build --filter apps/web-app

Configuration

[build]
  publish = "dist/web-app"
  command = "npm run build:main-app"
  functions = "./functions"
  environment = { NODE_ENV = "development", NODE_VERSION = "20.6.1" }
[[plugins]]
  package = "@netlify/plugin-functions-install-core"

# Since this is a single page application, we need to redirect all requests to the index.html file
[[redirects]]
  from = "/en/*"
  to = "/en/index.html"
  status = 200

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

# fallback for URLs without language prefix
[[redirects]]
  from = "/*"
  to = "/en/index.html"
  status = 200

Environment

I am using [email protected].

System:
    OS: macOS 14.3.1
    Memory: 1.50 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
Binaries:
    Node: 20.6.1 - ~/.nvm/versions/node/v20.6.1/bin/node
    npm: 9.8.1 - ~/.nvm/versions/node/v20.6.1/bin/npm

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions