Error at deployed site with netlify, "could not find redwood.tml file."

Hello, I’m working on a personal project using Redwood and thanks to that, I’ve saved a lot of time.

Here’s my situation.
I deployed with Netlify as it was in the Redwood docs, and it was completed without any problems.
However, an error could not find redwood.toml file, ... occurs when requesting API (attempting to sign up) on the published site.

  • The redwood.toml file is located at the top level of the project.
  • I haven’t modified the redwood.toml file since it was automatically generated using the command yarn rw setup deploy netlify.
  • The project is using dbAuth.
  • The version of redwood used in the project is canary version cause I’d like to use React suspense.

I also saw the issue of the error kind of module was not found ... during the deployment and the official document related to the toml file configuration, but I didn’t get much help.

Is there anything else I can do?
Thank you in advance.

Here are some of the project code.

  • package.json at the top level.
{
  "private": true,
  "workspaces": {
    "packages": [
      "api",
      "web"
    ]
  },
  "devDependencies": {
    "@redwoodjs/auth-dbauth-setup": "7.0.0-canary.402",
    "@redwoodjs/cli-storybook": "7.0.0-canary.402",
    "@redwoodjs/core": "7.0.0-canary.402",
    "prettier-plugin-tailwindcss": "0.4.1"
  },
  "eslintConfig": {
    "extends": "@redwoodjs/eslint-config",
    "root": true
  },
  "engines": {
    "node": "=18.x",
    "yarn": ">=1.15"
  },
  "prisma": {
    "seed": "yarn rw exec seed"
  },
  "packageManager": "yarn@3.6.1",
  "dependencies": {
    "date-fns": "^2.30.0"
  }
}
  • redwood.toml
[web]
  title = "Redwood App"
  port = 8910
  apiUrl = "/.netlify/functions"
  includeEnvironmentVariables = []
[api]
  port = 8911
[browser]
  open = true
[notifications]
  versionUpdates = ["latest"]

[experimental.streamingSsr]
  enabled = true
  • netlify.toml
[build]
  command = "yarn rw deploy netlify"
  publish = "web/dist"
  functions = "api/dist/functions"

[dev]
  framework = "redwoodjs"
  targetPort = 8910
  port = 8888

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

Hey @yesl-kim, thanks for trying out redwood! I’ll take a look at reproducing this. I haven’t spent too much time working with netlify but I’ll bring it up with the rest of the team too. It might help if you would be happy to share the stacktrace of that error if you have one - it might help us narrow down where in the codebase this is happening.

From my understanding this happens because when you deploy to netlify the redwood.toml isn’t shipped to netlify along with the rest of your code. This is normally totally fine but occasionally there’s code in the framework which tries to read the toml file and then this sort of error occurs. We try our best to catch these sort of problems before they go out but they do sometimes happen on the canary version. They tend to be not too hard to fix though so hopefully we can get things working again reasonably quickly.

Thank you so much for your quick reply!

First of all, let me share the github repo and the distributed site for any other necessary information.

  1. Stacktrace of the error
    Since the deployment, The following message is logged several times in graphql function log.
Nov 13, 09:44:14 AM: {"level":50,"time":1699836030736,"pid":8,"hostname":"169.254.80.61","err":{"type":"Error","message":"Exception in getAuthenticationContext: The `Authorization` header is not valid.","stack":"Error: Exception in getAuthenticationContext: The `Authorization` header is not valid.\n    at onContextBuilding (/var/task/node_modules/@redwoodjs/graphql-server/dist/plugins/useRedwoodAuthContext.js:30:15)\n    at async Object.contextFactory (/var/task/node_modules/graphql-yoga/node_modules/@envelop/core/cjs/orchestrator.js:202:45)\n    at async processRequest (/var/task/node_modules/graphql-yoga/cjs/process-request.js:46:26)\n    at async YogaServer.getResultForParams (/var/task/node_modules/graphql-yoga/cjs/server.js:304:26)\n    at async YogaServer.handle (/var/task/node_modules/graphql-yoga/cjs/server.js:77:29)\n    at async handlerFn (/var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:90:24)\n    at async execFn (/var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:147:16)"},"msg":"Exception in getAuthenticationContext: The `Authorization` header is not valid."}
Nov 13, 09:44:14 AM: {"level":50,"time":1699836254138,"pid":8,"hostname":"169.254.80.61","name":"graphql-server","msg":"Error building context. Error: Exception in getAuthenticationContext: The `Authorization` header is not valid."}
Nov 13, 09:44:14 AM: {"level":50,"time":1699836254139,"pid":8,"hostname":"169.254.80.61","err":{"type":"Error","message":"Exception in getAuthenticationContext: The `Authorization` header is not valid.","stack":"Error: Exception in getAuthenticationContext: The `Authorization` header is not valid.\n    at onContextBuilding (/var/task/node_modules/@redwoodjs/graphql-server/dist/plugins/useRedwoodAuthContext.js:30:15)\n    at async Object.contextFactory (/var/task/node_modules/graphql-yoga/node_modules/@envelop/core/cjs/orchestrator.js:202:45)\n    at async processRequest (/var/task/node_modules/graphql-yoga/cjs/process-request.js:46:26)\n    at async YogaServer.getResultForParams (/var/task/node_modules/graphql-yoga/cjs/server.js:304:26)\n    at async YogaServer.handle (/var/task/node_modules/graphql-yoga/cjs/server.js:77:29)\n    at async handlerFn (/var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:90:24)\n    at async execFn (/var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:147:16)"},"msg":"Exception in getAuthenticationContext: The `Authorization` header is not valid."}
Nov 13, 09:44:14 AM: c75baa25 Duration: 136.92 ms	Memory Usage: 151 MB
  1. As you said, there was no redwood.toml file in the deployed file.
2 Likes

Hey @yesl-kim, thanks for sharing a reproduction! I’m thinking that this may be related to the version you’re on. Recently I saw the same error in our deploy CI and merged this fix in response:

This fix landed in 7.0.0-canary.437. Upgrading the version of canary you’re on may do the trick: yarn rw upgrade -t canary. (The latest version of canary is 7.0.0-canary.473)

Just curious, any particular reason you’re on canary? Trying out one of the experimental features?

Just a quick update: I tried deploying the latest canary and it didn’t seem to work. That seems like it has a different bug. The version I mentioned though (7.0.0-canary.437) deployed successfully and seems stable.

Checked it. Thank you! It really works!

The reason for using the canary version was to use Suspense.
Cell was useful but, to specify the UI based on loading and error conditions on the part of using the component.

I haven’t used any other features yet :slight_smile:

1 Like