[GH-ISSUE #3729] [bug]: App caused error when smtp_url is not found #1292

Closed
opened 2026-03-16 19:40:46 +03:00 by kerem · 1 comment
Owner

Originally created by @aliuq on GitHub (Jan 7, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3729

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

I don't think I need to set up Mailer, but not setting up Mailer gives me an error and causes the service to fail to start!

hoppscotch-hoppscotch-1     | Backend Server | > hoppscotch-backend@2023.12.2 start:prod /usr/src/app/packages/hoppscotch-backend
hoppscotch-hoppscotch-1     | Backend Server | > node dist/main
hoppscotch-hoppscotch-1     | Backend Server | [Nest] 66  - 01/07/2024, 6:26:34 PM     LOG [NestFactory] Starting Nest application...
hoppscotch-hoppscotch-1     | Backend Server | [Nest] 66  - 01/07/2024, 6:26:34 PM   ERROR [ExceptionHandler] mailer/smtp_url_undefined
hoppscotch-hoppscotch-1     | Backend Server | Error: mailer/smtp_url_undefined
hoppscotch-hoppscotch-1     | Backend Server |     at throwErr (/usr/src/app/packages/hoppscotch-backend/dist/utils.js:14:11)
hoppscotch-hoppscotch-1     | Backend Server |     at MailerModule.register (/usr/src/app/packages/hoppscotch-backend/dist/mailer/mailer.module.js:33:122)
hoppscotch-hoppscotch-1     | Backend Server |     at async ModuleCompiler.compile (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/injector/compiler.js:10:64)
hoppscotch-hoppscotch-1     | Backend Server |     at async NestContainer.addModule (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/injector/container.js:53:50)
hoppscotch-hoppscotch-1     | Backend Server |     at async DependenciesScanner.scanForModules (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/scanner.js:37:74)
hoppscotch-hoppscotch-1     | Backend Server |     at async DependenciesScanner.scanForModules (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/scanner.js:68:32)
hoppscotch-hoppscotch-1     | Backend Server |     at async DependenciesScanner.scan (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/scanner.js:27:9)
hoppscotch-hoppscotch-1     | Backend Server |     at async /usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-factory.js:107:17
hoppscotch-hoppscotch-1     | Backend Server |     at async ExceptionsZone.asyncRun (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/errors/exceptions-zone.js:22:13)
hoppscotch-hoppscotch-1     | Backend Server |     at async NestFactoryStatic.initialize (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-factory.js:106:13)
hoppscotch-hoppscotch-1     | Backend Server | ELIFECYCLE  Command failed with exit code 1.
hoppscotch-hoppscotch-1     | Exiting process because Backend Server exited with code 1
hoppscotch-hoppscotch-1 exited with code 0

Steps to reproduce

.env

ENABLE_SUBPATH_BASED_ACCESS=true

docker-compose.yaml

version: "3.7"

services:
  hoppscotch:
    image: hoppscotch/hoppscotch
    restart: unless-stopped
    env_file: ./.env
    depends_on:
      hoppscotch-db:
        condition: service_healthy
    ports:
      - 3000:3000

  hoppscotch-db:
    image: postgres:15
    restart: unless-stopped
    environment:
      POSTGRES_USER: xxx
      POSTGRES_PASSWORD: xxx
      POSTGRES_DB: hoppscotch
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'"
        ]
      interval: 5s
      timeout: 5s
      retries: 10

Environment

Production

Version

Self-hosted

Originally created by @aliuq on GitHub (Jan 7, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3729 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior I don't think I need to set up Mailer, but not setting up Mailer gives me an error and causes the service to fail to start! ```bash hoppscotch-hoppscotch-1 | Backend Server | > hoppscotch-backend@2023.12.2 start:prod /usr/src/app/packages/hoppscotch-backend hoppscotch-hoppscotch-1 | Backend Server | > node dist/main hoppscotch-hoppscotch-1 | Backend Server | [Nest] 66 - 01/07/2024, 6:26:34 PM LOG [NestFactory] Starting Nest application... hoppscotch-hoppscotch-1 | Backend Server | [Nest] 66 - 01/07/2024, 6:26:34 PM ERROR [ExceptionHandler] mailer/smtp_url_undefined hoppscotch-hoppscotch-1 | Backend Server | Error: mailer/smtp_url_undefined hoppscotch-hoppscotch-1 | Backend Server | at throwErr (/usr/src/app/packages/hoppscotch-backend/dist/utils.js:14:11) hoppscotch-hoppscotch-1 | Backend Server | at MailerModule.register (/usr/src/app/packages/hoppscotch-backend/dist/mailer/mailer.module.js:33:122) hoppscotch-hoppscotch-1 | Backend Server | at async ModuleCompiler.compile (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/injector/compiler.js:10:64) hoppscotch-hoppscotch-1 | Backend Server | at async NestContainer.addModule (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/injector/container.js:53:50) hoppscotch-hoppscotch-1 | Backend Server | at async DependenciesScanner.scanForModules (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/scanner.js:37:74) hoppscotch-hoppscotch-1 | Backend Server | at async DependenciesScanner.scanForModules (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/scanner.js:68:32) hoppscotch-hoppscotch-1 | Backend Server | at async DependenciesScanner.scan (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/scanner.js:27:9) hoppscotch-hoppscotch-1 | Backend Server | at async /usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-factory.js:107:17 hoppscotch-hoppscotch-1 | Backend Server | at async ExceptionsZone.asyncRun (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/errors/exceptions-zone.js:22:13) hoppscotch-hoppscotch-1 | Backend Server | at async NestFactoryStatic.initialize (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-factory.js:106:13) hoppscotch-hoppscotch-1 | Backend Server | ELIFECYCLE  Command failed with exit code 1. hoppscotch-hoppscotch-1 | Exiting process because Backend Server exited with code 1 hoppscotch-hoppscotch-1 exited with code 0 ``` ### Steps to reproduce `.env` ```env ENABLE_SUBPATH_BASED_ACCESS=true ``` `docker-compose.yaml` ```yaml version: "3.7" services: hoppscotch: image: hoppscotch/hoppscotch restart: unless-stopped env_file: ./.env depends_on: hoppscotch-db: condition: service_healthy ports: - 3000:3000 hoppscotch-db: image: postgres:15 restart: unless-stopped environment: POSTGRES_USER: xxx POSTGRES_PASSWORD: xxx POSTGRES_DB: hoppscotch volumes: - ./pgdata:/var/lib/postgresql/data healthcheck: test: [ "CMD-SHELL", "sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'" ] interval: 5s timeout: 5s retries: 10 ``` ### Environment Production ### Version Self-hosted
kerem 2026-03-16 19:40:46 +03:00
Author
Owner

@balub commented on GitHub (Jan 11, 2024):

@aliuq setting up the mailer is a required process to send emails out to invite users on to the platform, hence not setting it up will result in the error you see.

<!-- gh-comment-id:1886623419 --> @balub commented on GitHub (Jan 11, 2024): @aliuq setting up the mailer is a required process to send emails out to invite users on to the platform, hence not setting it up will result in the error you see.
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#1292
No description provided.