question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Error with Strapi 4.3.2

See original GitHub issue

Bug report

Describe the bug

Somehow, when trying to get into the Sitemap view we are getting this problem:

[2022-08-07 23:30:00.122] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:31:00.132] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:32:00.149] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:95) Warning: [deprecated] In future versions, Strapi will stop reading directly from the environment variable API_TOKEN_SALT. Please set apiToken.salt in config/admin.js instead.
For security reasons, keep storing the secret in an environment variable and use env() to read it in config/admin.js (ex: `apiToken: { salt: env('API_TOKEN_SALT') }`). See https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#configuration-using-environment-variables.
(Use `node --trace-warnings ...` to show where the warning was created)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
[2022-08-07 23:33:00.198] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:34:00.188] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:35:00.187] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:36:00.152] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:37:00.161] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:38:00.151] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:38:10.917] info: File created: /srv/app/docker-compose.yaml
Starting the compilation for TypeScript files in /srv/app
The server is restarting

[2022-08-07 23:39:23.680] info: --------  MIGRATION STARTED  --------
[2022-08-07 23:39:23.702] warn: No migration directory found.
[2022-08-07 23:39:23.703] info: --------  MIGRATION FINISHED  --------
[2022-08-07 23:39:23.741] info: [website builder] manual trigger enabled

 Project information

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Time               β”‚ Sun Aug 07 2022 23:39:24 GMT+0000 (Coordinated … β”‚
β”‚ Launched in        β”‚ 27742 ms                                         β”‚
β”‚ Environment        β”‚ development                                      β”‚
β”‚ Process PID        β”‚ 95                                               β”‚
β”‚ Version            β”‚ 4.3.2 (node v14.20.0)                            β”‚
β”‚ Edition            β”‚ Community                                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

 Actions available

Welcome back!
To manage your project πŸš€, go to the administration panel at:
http://localhost:1337/admin

To access the server ⚑️, go to:
http://localhost:1337

[2022-08-07 23:40:00.154] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:41:00.162] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:42:00.163] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:43:00.145] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:44:00.157] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:45:00.184] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:46:00.220] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:47:00.184] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:48:00.174] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:49:00.134] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
[2022-08-07 23:50:00.162] error: [strapi-plugin-sitemap]: Something went wrong while trying to build the SitemapStream. TypeError [ERR_INVALID_URL]: Invalid URL: 
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error
    at Object.createSitemap (/srv/app/node_modules/strapi-plugin-sitemap/server/services/core.js:248:11)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

This altogether

Steps to reproduce the behavior

  1. Go Sitemap.
  2. Go to the container logs(either in terminal or docker desktop).
  3. Scroll down to find the error.
  4. See an error

Expected behavior

We should not get any error in both the docker logs and the website.

Screenshots

sitemaperror

System

  • Node.js version: 4.3.2 (node v14.20.0)
  • Strapi version: 4.3.2
  • Plugin version: 2.0.8
  • Database: PostgreSQL 13.7
  • Operating system: Alpine Linux v3.16

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
boazpoolmancommented, Sep 15, 2022

It could. But then again you would need to set custom URLs or URL bundles to even have it make sense to generate the sitemap. So I don’t see a reason to have a default hostname.

1reaction
boazpoolmancommented, Sep 6, 2022

Ah allright. So you do have cron setup to generate the sitemap. Though you have not set the hostname yet. Then indeed it will give an error.

Please go through the settings form before trying to generate the sitemap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues Β· strapi/strapi - GitHub
Strapi is the leading open-source headless CMS. ... Issues Β· strapi/strapi. ... [Bug]: REST API UPDATE Error at 4.5.4 version when data with...
Read more >
Getting internal server error instead of Forbidden
I drilled down into the source code a bit and I found that in @strapi/strapi/lib/services/server/compose-endpoint.js there is logic thatΒ ...
Read more >
Changelog - Strapi
Bug fixes: Remove limit on deep populate on components ... Error handling with improved messages and standardised error codes makes it easier to...
Read more >
ISSUE 4.3.8 after update SQLITE Error near "Returnin"
System Information Strapi Version: 4.3.8 Operating System: Database: SQLITE Node Version: NPM Version: Yarn Version: With 4.3.6 it workedΒ ...
Read more >
Strapi Custom service types - Questions and Answers
I was on Strapi 4.3.2 and already had time to type my custom servi… ... procedure in Windows Β· Issue #14306 Β· strapi/strapi...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found