[GH-ISSUE #4921] Backend Server | URIError: URI malformed #1854

Closed
opened 2026-03-16 22:05:47 +03:00 by kerem · 3 comments
Owner

Originally created by @marcellocello on GitHub (Mar 20, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4921

Originally assigned to: @mirarifhasan on GitHub.

I tried to install hoppscotch on self hosted and got the following error "Backend Server | URIError: URI malformed", I am using Ubuntu 24.04.2 LTS

.env file, mailer section:

MAILER_SMTP_ENABLE=true
MAILER_USE_CUSTOM_CONFIGS=true
MAILER_ADDRESS_FROM=MyName
MAILER_SMTP_URL=smtps://myname@gmail.com:myPass%405050@smtp.gmail.com:587

MAILER_SMTP_HOST=smtp.gmail.com
MAILER_SMTP_PORT=587
MAILER_SMTP_SECURE=false
MAILER_SMTP_USER=myname@gmail.com
MAILER_SMTP_PASSWORD=myPass%405050
MAILER_TLS_REJECT_UNAUTHORIZED=true

logs:

Webapp Server |  INFO webapp_server: Initializing Hoppscotch Web Static Server
Webapp Server |  INFO webapp_server::signing::key: Generating new signing key pair
Webapp Server |  INFO webapp_server::signing::key: Generated new signing key pair key_id=key_20250320_025056
Webapp Server |  INFO webapp_server::signing::key: signing_key_bytes_encoded="DHwXFdZ+CSSAjRRRgK+DEfNKJllsyYxuiCg2E6QQ/KE="
Webapp Server |  INFO webapp_server::signing::key: verifying_key_bytes_encoded="zetrX0m69CAU7RFa3RPwQsgUerz+TQjxNAvE2bWK18o="
Webapp Server |  INFO webapp_server: Frontend path verified frontend_path="/site/selfhost-web"
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.300889,"msg":"using config from file","file":"/etc/caddy/aio-multiport-setup.Caddyfile"}
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3043811,"msg":"adapted config to JSON","adapter":"caddyfile"}
App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3055458,"logger":"admin","msg":"admin endpoint disabled"}
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3060153,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000620e80"}
App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3071914,"logger":"http","msg":"HTTP/2 skipped because it requires TLS","network":"tcp","addr":":3000"}
App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3072412,"logger":"http","msg":"HTTP/3 skipped because it requires TLS","network":"tcp","addr":":3000"}
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3072648,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.30743,"logger":"http","msg":"HTTP/2 skipped because it requires TLS","network":"tcp","addr":":3100"}
App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3074558,"logger":"http","msg":"HTTP/3 skipped because it requires TLS","network":"tcp","addr":":3100"}
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3075304,"logger":"http.log","msg":"server running","name":"srv1","protocols":["h1","h2","h3"]}
App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3076887,"logger":"http","msg":"HTTP/2 skipped because it requires TLS","network":"tcp","addr":":3170"}
App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.307713,"logger":"http","msg":"HTTP/3 skipped because it requires TLS","network":"tcp","addr":":3170"}
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3077276,"logger":"http.log","msg":"server running","name":"srv2","protocols":["h1","h2","h3"]}
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3077612,"msg":"serving initial configuration"}
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.348678,"logger":"tls","msg":"cleaning storage unit","storage":"FileStorage:/root/.local/share/caddy"}
App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.4099915,"logger":"tls","msg":"finished cleaning storage units"}
App/Admin Dashboard Caddy | {"level":"error","ts":1742439056.7778678,"logger":"http.log.error","msg":"dial tcp [::1]:8080: connect: connection refused","request":{"remote_ip":"::1","remote_port":"49592","client_ip":"::1","proto":"HTTP/1.1","method":"HEAD","host":"localhost:3170","uri":"/ping","headers":{"User-Agent":["curl/8.12.1"],"Accept":["*/*"]}},"duration":0.004081204,"status":502,"err_id":"ha5k1upef","err_trace":"reverseproxy.statusError (reverseproxy.go:1373)"}
Webapp Server |  INFO webapp_server: Initialized bundle builder from path frontend_path="/site/selfhost-web"
Webapp Server |  INFO webapp_server: Bundle built successfully with 252 files
Webapp Server |  INFO webapp_server::bundle::manager: Initializing BundleManager with a new bundle
Webapp Server |  INFO webapp_server::bundle::manager: Successfully created initial bundle
Webapp Server |  INFO webapp_server: Bundle signed and stored successfully in the bundle manager
Webapp Server |  INFO webapp_server::api: Setting up API routes
Webapp Server |  INFO webapp_server: Attempting to bind to address: 0.0.0.0:3200
Webapp Server |  INFO webapp_server: Server successfully bound to 0.0.0.0:3200
Webapp Server |  INFO webapp_server: Starting server
Backend Server | [Nest] 49  - 03/20/2025, 2:50:58 AM     LOG [NestFactory] Starting Nest application...
App/Admin Dashboard Caddy | {"level":"error","ts":1742439058.9586155,"logger":"http.log.error","msg":"dial tcp [::1]:8080: connect: connection refused","request":{"remote_ip":"::1","remote_port":"49602","client_ip":"::1","proto":"HTTP/1.1","method":"HEAD","host":"localhost:3170","uri":"/ping","headers":{"User-Agent":["curl/8.12.1"],"Accept":["*/*"]}},"duration":0.001456262,"status":502,"err_id":"urwd8fmw3","err_trace":"reverseproxy.statusError (reverseproxy.go:1373)"}
Backend Server | Using simple mailer configuration
Backend Server | [Nest] 49  - 03/20/2025, 2:50:59 AM     LOG [InstanceLoader] MailerModule dependencies initialized +578ms
Backend Server | [Nest] 49  - 03/20/2025, 2:50:59 AM     LOG [InstanceLoader] PubSubModule dependencies initialized +0ms
Backend Server | [Nest] 49  - 03/20/2025, 2:50:59 AM     LOG [InstanceLoader] PrismaModule dependencies initialized +0ms
Backend Server | [Nest] 49  - 03/20/2025, 2:50:59 AM     LOG [InstanceLoader] PassportModule dependencies initialized +0ms
Backend Server | [Nest] 49  - 03/20/2025, 2:50:59 AM   ERROR [ExceptionHandler] URI malformed
Backend Server | URIError: URI malformed
Backend Server |     at decodeURIComponent (<anonymous>)
Backend Server |     at Url.parse (node:url:357:19)
Backend Server |     at Object.urlParse [as parse] (node:url:141:13)
Backend Server |     at module.exports.parseConnectionUrl (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/shared/index.js:275:13)
Backend Server |     at module.exports.createTransport (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/nodemailer.js:34:30)
Backend Server |     at MailerTransportFactory.createTransport (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer-transport.factory.js:13:49)
Backend Server |     at MailerService.createTransporter (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:68:51)
Backend Server |     at MailerService.setupTransporters (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:82:37)
Backend Server |     at new MailerService (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:58:14)
Backend Server |     at Injector.instantiateClass (/dist/backend/node_modules/.pnpm/@nestjs+core@10.4.4_@nestjs+common@10.4.4_class-transformer@0.5.1_class-validator@0.14._888121cfb1202a7b428592c174f49f51/node_modules/@nestjs/core/injector/injector.js:365:19)
Exiting process because Backend Server exited with code null
Originally created by @marcellocello on GitHub (Mar 20, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4921 Originally assigned to: @mirarifhasan on GitHub. I tried to install hoppscotch on self hosted and got the following error "Backend Server | URIError: URI malformed", I am using Ubuntu 24.04.2 LTS .env file, mailer section: ``` MAILER_SMTP_ENABLE=true MAILER_USE_CUSTOM_CONFIGS=true MAILER_ADDRESS_FROM=MyName MAILER_SMTP_URL=smtps://myname@gmail.com:myPass%405050@smtp.gmail.com:587 MAILER_SMTP_HOST=smtp.gmail.com MAILER_SMTP_PORT=587 MAILER_SMTP_SECURE=false MAILER_SMTP_USER=myname@gmail.com MAILER_SMTP_PASSWORD=myPass%405050 MAILER_TLS_REJECT_UNAUTHORIZED=true ``` logs: ``` Webapp Server | INFO webapp_server: Initializing Hoppscotch Web Static Server Webapp Server | INFO webapp_server::signing::key: Generating new signing key pair Webapp Server | INFO webapp_server::signing::key: Generated new signing key pair key_id=key_20250320_025056 Webapp Server | INFO webapp_server::signing::key: signing_key_bytes_encoded="DHwXFdZ+CSSAjRRRgK+DEfNKJllsyYxuiCg2E6QQ/KE=" Webapp Server | INFO webapp_server::signing::key: verifying_key_bytes_encoded="zetrX0m69CAU7RFa3RPwQsgUerz+TQjxNAvE2bWK18o=" Webapp Server | INFO webapp_server: Frontend path verified frontend_path="/site/selfhost-web" App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.300889,"msg":"using config from file","file":"/etc/caddy/aio-multiport-setup.Caddyfile"} App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3043811,"msg":"adapted config to JSON","adapter":"caddyfile"} App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3055458,"logger":"admin","msg":"admin endpoint disabled"} App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3060153,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000620e80"} App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3071914,"logger":"http","msg":"HTTP/2 skipped because it requires TLS","network":"tcp","addr":":3000"} App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3072412,"logger":"http","msg":"HTTP/3 skipped because it requires TLS","network":"tcp","addr":":3000"} App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3072648,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]} App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.30743,"logger":"http","msg":"HTTP/2 skipped because it requires TLS","network":"tcp","addr":":3100"} App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3074558,"logger":"http","msg":"HTTP/3 skipped because it requires TLS","network":"tcp","addr":":3100"} App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3075304,"logger":"http.log","msg":"server running","name":"srv1","protocols":["h1","h2","h3"]} App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.3076887,"logger":"http","msg":"HTTP/2 skipped because it requires TLS","network":"tcp","addr":":3170"} App/Admin Dashboard Caddy | {"level":"warn","ts":1742439056.307713,"logger":"http","msg":"HTTP/3 skipped because it requires TLS","network":"tcp","addr":":3170"} App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3077276,"logger":"http.log","msg":"server running","name":"srv2","protocols":["h1","h2","h3"]} App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.3077612,"msg":"serving initial configuration"} App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.348678,"logger":"tls","msg":"cleaning storage unit","storage":"FileStorage:/root/.local/share/caddy"} App/Admin Dashboard Caddy | {"level":"info","ts":1742439056.4099915,"logger":"tls","msg":"finished cleaning storage units"} App/Admin Dashboard Caddy | {"level":"error","ts":1742439056.7778678,"logger":"http.log.error","msg":"dial tcp [::1]:8080: connect: connection refused","request":{"remote_ip":"::1","remote_port":"49592","client_ip":"::1","proto":"HTTP/1.1","method":"HEAD","host":"localhost:3170","uri":"/ping","headers":{"User-Agent":["curl/8.12.1"],"Accept":["*/*"]}},"duration":0.004081204,"status":502,"err_id":"ha5k1upef","err_trace":"reverseproxy.statusError (reverseproxy.go:1373)"} Webapp Server | INFO webapp_server: Initialized bundle builder from path frontend_path="/site/selfhost-web" Webapp Server | INFO webapp_server: Bundle built successfully with 252 files Webapp Server | INFO webapp_server::bundle::manager: Initializing BundleManager with a new bundle Webapp Server | INFO webapp_server::bundle::manager: Successfully created initial bundle Webapp Server | INFO webapp_server: Bundle signed and stored successfully in the bundle manager Webapp Server | INFO webapp_server::api: Setting up API routes Webapp Server | INFO webapp_server: Attempting to bind to address: 0.0.0.0:3200 Webapp Server | INFO webapp_server: Server successfully bound to 0.0.0.0:3200 Webapp Server | INFO webapp_server: Starting server Backend Server | [Nest] 49 - 03/20/2025, 2:50:58 AM LOG [NestFactory] Starting Nest application... App/Admin Dashboard Caddy | {"level":"error","ts":1742439058.9586155,"logger":"http.log.error","msg":"dial tcp [::1]:8080: connect: connection refused","request":{"remote_ip":"::1","remote_port":"49602","client_ip":"::1","proto":"HTTP/1.1","method":"HEAD","host":"localhost:3170","uri":"/ping","headers":{"User-Agent":["curl/8.12.1"],"Accept":["*/*"]}},"duration":0.001456262,"status":502,"err_id":"urwd8fmw3","err_trace":"reverseproxy.statusError (reverseproxy.go:1373)"} Backend Server | Using simple mailer configuration Backend Server | [Nest] 49 - 03/20/2025, 2:50:59 AM LOG [InstanceLoader] MailerModule dependencies initialized +578ms Backend Server | [Nest] 49 - 03/20/2025, 2:50:59 AM LOG [InstanceLoader] PubSubModule dependencies initialized +0ms Backend Server | [Nest] 49 - 03/20/2025, 2:50:59 AM LOG [InstanceLoader] PrismaModule dependencies initialized +0ms Backend Server | [Nest] 49 - 03/20/2025, 2:50:59 AM LOG [InstanceLoader] PassportModule dependencies initialized +0ms Backend Server | [Nest] 49 - 03/20/2025, 2:50:59 AM ERROR [ExceptionHandler] URI malformed Backend Server | URIError: URI malformed Backend Server | at decodeURIComponent (<anonymous>) Backend Server | at Url.parse (node:url:357:19) Backend Server | at Object.urlParse [as parse] (node:url:141:13) Backend Server | at module.exports.parseConnectionUrl (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/shared/index.js:275:13) Backend Server | at module.exports.createTransport (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/nodemailer.js:34:30) Backend Server | at MailerTransportFactory.createTransport (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer-transport.factory.js:13:49) Backend Server | at MailerService.createTransporter (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:68:51) Backend Server | at MailerService.setupTransporters (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:82:37) Backend Server | at new MailerService (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:58:14) Backend Server | at Injector.instantiateClass (/dist/backend/node_modules/.pnpm/@nestjs+core@10.4.4_@nestjs+common@10.4.4_class-transformer@0.5.1_class-validator@0.14._888121cfb1202a7b428592c174f49f51/node_modules/@nestjs/core/injector/injector.js:365:19) Exiting process because Backend Server exited with code null ```
kerem closed this issue 2026-03-16 22:05:52 +03:00
Author
Owner

@mirarifhasan commented on GitHub (Mar 21, 2025):

@marcellocello
After inspecting the logs, it looks like you initially used a simpler mailer configuration:

MAILER_USE_CUSTOM_CONFIGS=false
(As indicated by the backend server log: "Using simple mailer configuration") 

Later on, it seems you updated your .env file. However, since our backend is designed to retain previous configurations, this is likely causing the error.
If you can provide us with the previously used MAILER_SMTP_URL, we can try to reproduce the issue on our end.

In the meantime, a quick fix would be:

  1. Open the InfraConfig table in the database and delete a row where name = MAILER_SMTP_ENABLE.
  2. Stop and Restart again the Hoppscotch Docker container.
<!-- gh-comment-id:2743811559 --> @mirarifhasan commented on GitHub (Mar 21, 2025): @marcellocello After inspecting the logs, it looks like you initially used a simpler mailer configuration: ``` MAILER_USE_CUSTOM_CONFIGS=false (As indicated by the backend server log: "Using simple mailer configuration") ``` Later on, it seems you updated your .env file. However, since our backend is designed to retain previous configurations, this is likely causing the error. If you can provide us with the previously used `MAILER_SMTP_URL`, we can try to reproduce the issue on our end. In the meantime, a quick fix would be: 1. Open the `InfraConfig` table in the database and delete a row where `name = MAILER_SMTP_ENABLE`. 2. Stop and Restart again the Hoppscotch Docker container.
Author
Owner

@marcellocello commented on GitHub (Mar 21, 2025):

thanks for your response and help. now the application can be run, however, when I click Login an error appears "Unable to load auth providers". I have setup Microsoft Auth in .env file

VITE_ALLOWED_AUTH_PROVIDERS=MICROSOFT
# Microsoft Auth Config
MICROSOFT_CLIENT_ID=***this my microsoft client id***
MICROSOFT_CLIENT_SECRET=***this my microsoft client secret***
MICROSOFT_CALLBACK_URL=http://localhost:3170/v1/auth/microsoft/callback
MICROSOFT_SCOPE=user.read
MICROSOFT_TENANT=common
Image

and this is when I access port 3100

Image
<!-- gh-comment-id:2743920164 --> @marcellocello commented on GitHub (Mar 21, 2025): thanks for your response and help. now the application can be run, however, when I click Login an error appears "Unable to load auth providers". I have setup Microsoft Auth in .env file ``` VITE_ALLOWED_AUTH_PROVIDERS=MICROSOFT # Microsoft Auth Config MICROSOFT_CLIENT_ID=***this my microsoft client id*** MICROSOFT_CLIENT_SECRET=***this my microsoft client secret*** MICROSOFT_CALLBACK_URL=http://localhost:3170/v1/auth/microsoft/callback MICROSOFT_SCOPE=user.read MICROSOFT_TENANT=common ``` <img width="1798" alt="Image" src="https://github.com/user-attachments/assets/7957ee96-daaf-4377-8c2a-0c1ba0d8521e" /> and this is when I access port 3100 <img width="1798" alt="Image" src="https://github.com/user-attachments/assets/5ab760f4-d80f-4e63-83d6-1da0157a6b56" />
Author
Owner

@mirarifhasan commented on GitHub (Mar 21, 2025):

@marcellocello
Can you provide the browser's network log?
Also, if any errors occur, please provide the Docker container logs.

<!-- gh-comment-id:2744640070 --> @mirarifhasan commented on GitHub (Mar 21, 2025): @marcellocello Can you provide the browser's network log? Also, if any errors occur, please provide the Docker container logs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1854
No description provided.