nwtgck / actions-netlify

🚀 Netlify deploy from GitHub Actions
MIT License
332 stars 41 forks source link

Error: Request path contains unescaped characters #689

Closed KnorpelSenf closed 2 years ago

KnorpelSenf commented 2 years ago

I keep on running into the same issue and the error message is not helpful. All I get is this:

Run nwtgck/actions-netlify@v1.2
  with:
    publish-dir: ./bundling/bundles
    production-branch: main
    netlify-config-path: ./bundling/bundles/netlify.toml
  env:
    NETLIFY_SITE_ID: ***
    NETLIFY_AUTH_TOKEN: ***
Error: Request path contains unescaped characters

How can I investigate what the problem is?

FYI there are no weird characters in the publish directoy:

Run find bundling
bundling
bundling/.gitignore
bundling/bundle-es6.ts
bundling/bundles
bundling/bundles/es6-dev.js
bundling/bundles/es6-v1.4.2.js
bundling/bundles/netlify.toml
bundling/netlify.toml
nwtgck commented 2 years ago

Thanks for the report. I'll see https://github.com/grammyjs/grammY/pull/111.

nwtgck commented 2 years ago

@KnorpelSenf I posted a comment on grammyjs/grammY#111.

nwtgck commented 2 years ago

Notes: Where the error message come from (root):

Example

The simple example bellow will help us to find how to fix.

> const http = require("http");
// NOTE: the URL contains a white space.
> http.get({path: "https://example.com "})
Uncaught:
TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
KnorpelSenf commented 2 years ago

It would be very helpful to know what operation is attempted when the unescaped characters are found. Even better would be to print the path with the unescaped characters to stderr/stdout.

Is it a file path? Is it the path in a URL? Which file or URL would that be?

Is there any way to print more logs so we can see what's going on?

KnorpelSenf commented 2 years ago

The credentials are used in query parameters. The issue was some accidental whitespace in the NETLIFY_SITE_ID secret. Given that authentication credentials are part of the URL, it makes sense not to log them publicly. @nwtgck thank you for your help!