[GH-ISSUE #70] Docker Container throws exit code 1 #31

Closed
opened 2026-05-07 00:18:00 +02:00 by BreizhHardware · 6 comments

Originally created by @kamikaze2508 on GitHub (Jun 20, 2025).
Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/70

Originally assigned to: @glenndehaan on GitHub.

The question

Hello everyone,

I have a problem with starting the container.
After I edit the YAML-File and start the container I've got the exit code 1. A view in the log shows following entries:

                       UniFi Voucher                           
                     By: Glenn de Haan                         
     https://github.com/glenndehaan/unifi-voucher-site         

2025-06-20 07:47:40.728 INFO [Version] Git: master - Build: 11/06/2025, 18:12
2025-06-20 07:47:40.728 INFO [Service][Web] Enabled!
2025-06-20 07:47:40.728 INFO [Service][Api] Disabled!
2025-06-20 07:47:40.728 INFO [Voucher] Loaded the following types:
/app/utils/types.js:18
return match.groups.expiration ? {...match.groups, raw: type} : undefined;
^
TypeError: Cannot read properties of null (reading 'groups')
at /app/utils/types.js:18:22
at Array.map ()
at module.exports (/app/utils/types.js:16:33)
at module.exports (/app/modules/info.js:71:5)
at Object. (/app/server.js:50:1)
at Module._compile (node:internal/modules/cjs/loader:1730:14)
at Object..js (node:internal/modules/cjs/loader:1895:10)
at Module.load (node:internal/modules/cjs/loader:1465:32)
at Function._load (node:internal/modules/cjs/loader:1282:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
Node.js v22.15.1

Can someone give me a hint what I need to do, to start the container correctly?

Thanks a lot.

Originally created by @kamikaze2508 on GitHub (Jun 20, 2025). Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/70 Originally assigned to: @glenndehaan on GitHub. ### The question Hello everyone, I have a problem with starting the container. After I edit the YAML-File and start the container I've got the exit code 1. A view in the log shows following entries: UniFi Voucher By: Glenn de Haan https://github.com/glenndehaan/unifi-voucher-site 2025-06-20 07:47:40.728 INFO [Version] Git: master - Build: 11/06/2025, 18:12 2025-06-20 07:47:40.728 INFO [Service][Web] Enabled! 2025-06-20 07:47:40.728 INFO [Service][Api] Disabled! 2025-06-20 07:47:40.728 INFO [Voucher] Loaded the following types: /app/utils/types.js:18 return match.groups.expiration ? {...match.groups, raw: type} : undefined; ^ TypeError: Cannot read properties of null (reading 'groups') at /app/utils/types.js:18:22 at Array.map (<anonymous>) at module.exports (/app/utils/types.js:16:33) at module.exports (/app/modules/info.js:71:5) at Object.<anonymous> (/app/server.js:50:1) at Module._compile (node:internal/modules/cjs/loader:1730:14) at Object..js (node:internal/modules/cjs/loader:1895:10) at Module.load (node:internal/modules/cjs/loader:1465:32) at Function._load (node:internal/modules/cjs/loader:1282:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) Node.js v22.15.1 Can someone give me a hint what I need to do, to start the container correctly? Thanks a lot.
BreizhHardware 2026-05-07 00:18:00 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@glenndehaan commented on GitHub (Jun 20, 2025):

Hi @kamikaze2508,

Looking at the logs it seems the input of the VOUCHER_TYPES environment variable is malformed.
Could you post the environment variables section from your YAML? Please remove sensitive parts before posting.

Kind regards,
Glenn de Haan

<!-- gh-comment-id:2990362692 --> @glenndehaan commented on GitHub (Jun 20, 2025): Hi @kamikaze2508, Looking at the logs it seems the input of the `VOUCHER_TYPES` environment variable is malformed. Could you post the environment variables section from your YAML? Please remove sensitive parts before posting. Kind regards, Glenn de Haan
Author
Owner

@kamikaze2508 commented on GitHub (Jun 20, 2025):

Here it is:

  # The IP address to your UniFi OS Console
  UNIFI_IP: 'My IP'
  # The port of your UniFi OS Console, this could be 443 or 8443
  UNIFI_PORT: 443
  # The username of a local UniFi OS account
  UNIFI_USERNAME: 'myusername'
  # The password of a local UniFi OS account
  UNIFI_PASSWORD: 'MyPassword'
  # The UniFi Site ID
  UNIFI_SITE_ID: 'default'
  # The UniFi SSID where guests need to connect to (Used within templating and 'Scan to Connect')
  UNIFI_SSID: 'MySSID'
  # The UniFi SSID WPA/WPA2/WPA3 Password (Can be ignored for 'Open' networks) (Used within templating and 'Scan to Connect')
  UNIFI_SSID_PASSWORD: ''
  # Toggle to enable/disable internal authentication
  AUTH_INTERNAL_ENABLED: 'true'
  # The password used to log in to the voucher portal Web UI
  AUTH_INTERNAL_PASSWORD: 'MyinternalPassword'
  # The Bearer token used for the API
  AUTH_INTERNAL_BEARER_TOKEN: '00000000-0000-0000-0000-000000000000'
  # Toggle to enable/disable OIDC authentication
  AUTH_OIDC_ENABLED: 'false'
  # OIDC issuer base url provided by oauth provider. Example: https://auth.example.com/.well-known/openid-configuration
  AUTH_OIDC_ISSUER_BASE_URL: ''
  # OIDC UniFi Voucher base url (This application). Example: https://voucher.example.com
  AUTH_OIDC_APP_BASE_URL: ''
  # OIDC client id provided by oauth provider
  AUTH_OIDC_CLIENT_ID: ''
  # OIDC client secret provided by oauth provider
  AUTH_OIDC_CLIENT_SECRET: ''
  # Disables the login/authentication for the portal and API
  AUTH_DISABLE: 'false'
  # Voucher Types, format: expiration in minutes (required),single-use or multi-use vouchers value - '0' is for multi-use (unlimited) - '1' is for single-use - 'N' is for multi-use (Nx) (optional),upload speed limit in kbps (optional),download speed limit in kbps (optional),data transfer limit in MB (optional)
  # To skip a parameter just but nothing in between the comma's
  # After a voucher type add a semicolon, after the semicolon you can start a new voucher type
  VOUCHER_TYPES: '480,1,,,;1440,1,,,;2880,1,,,;20160,N2,,,;'
  # Allow users to create custom vouchers types within the UI
  VOUCHER_CUSTOM: 'true'
  # Enable/disable the Web UI
  SERVICE_WEB: 'true'
  # Enable/disable the API
  SERVICE_API: 'false'
  # Enable/disable the printers and setup available printers, currently supported: pdf,escpos ip (Example: pdf,192.168.1.10)
  PRINTERS: ''
  # SMTP Mail from email address (optional)
  SMTP_FROM: 'mail@address.com'
  # SMTP Mail server hostname/ip (optional)
  SMTP_HOST: 'SMTP-Host-IP'
  # SMTP Mail server port (optional)
  SMTP_PORT: '25'
  # SMTP Mail use TLS? (optional)
  SMTP_SECURE: 'false'
  # SMTP Mail username (optional)
  SMTP_USERNAME: ''
  # SMTP Mail password (optional)
  SMTP_PASSWORD: ''
  # Enable/disable the kiosk page on /kiosk
  KIOSK_ENABLED: 'true'
  # Kiosk Voucher Type, format: expiration in minutes (required),single-use or multi-use vouchers value - '0' is for multi-use (unlimited) - '1' is for single-use - 'N' is for multi-use (Nx) (optional),upload speed limit in kbps (optional),download speed limit in kbps (optional),data transfer limit in MB (optional)
  # To skip a parameter just but nothing in between the comma's
  KIOSK_VOUCHER_TYPE: '480,1,,,;1440,1,,,;2880,1,,,;20160,N2,,,;'
  # Sets the application Log Level (Valid Options: error|warn|info|debug|trace)
  LOG_LEVEL: 'info'
  # Sets the default translation for dropdowns
  TRANSLATION_DEFAULT: 'de'
  # Enables/disables translation debugging, when enabled only translation keys are shown
  TRANSLATION_DEBUG: 'false'

Thank you for your fast replay

<!-- gh-comment-id:2990476313 --> @kamikaze2508 commented on GitHub (Jun 20, 2025): Here it is: # The IP address to your UniFi OS Console UNIFI_IP: 'My IP' # The port of your UniFi OS Console, this could be 443 or 8443 UNIFI_PORT: 443 # The username of a local UniFi OS account UNIFI_USERNAME: 'myusername' # The password of a local UniFi OS account UNIFI_PASSWORD: 'MyPassword' # The UniFi Site ID UNIFI_SITE_ID: 'default' # The UniFi SSID where guests need to connect to (Used within templating and 'Scan to Connect') UNIFI_SSID: 'MySSID' # The UniFi SSID WPA/WPA2/WPA3 Password (Can be ignored for 'Open' networks) (Used within templating and 'Scan to Connect') UNIFI_SSID_PASSWORD: '' # Toggle to enable/disable internal authentication AUTH_INTERNAL_ENABLED: 'true' # The password used to log in to the voucher portal Web UI AUTH_INTERNAL_PASSWORD: 'MyinternalPassword' # The Bearer token used for the API AUTH_INTERNAL_BEARER_TOKEN: '00000000-0000-0000-0000-000000000000' # Toggle to enable/disable OIDC authentication AUTH_OIDC_ENABLED: 'false' # OIDC issuer base url provided by oauth provider. Example: https://auth.example.com/.well-known/openid-configuration AUTH_OIDC_ISSUER_BASE_URL: '' # OIDC UniFi Voucher base url (This application). Example: https://voucher.example.com AUTH_OIDC_APP_BASE_URL: '' # OIDC client id provided by oauth provider AUTH_OIDC_CLIENT_ID: '' # OIDC client secret provided by oauth provider AUTH_OIDC_CLIENT_SECRET: '' # Disables the login/authentication for the portal and API AUTH_DISABLE: 'false' # Voucher Types, format: expiration in minutes (required),single-use or multi-use vouchers value - '0' is for multi-use (unlimited) - '1' is for single-use - 'N' is for multi-use (Nx) (optional),upload speed limit in kbps (optional),download speed limit in kbps (optional),data transfer limit in MB (optional) # To skip a parameter just but nothing in between the comma's # After a voucher type add a semicolon, after the semicolon you can start a new voucher type VOUCHER_TYPES: '480,1,,,;1440,1,,,;2880,1,,,;20160,N2,,,;' # Allow users to create custom vouchers types within the UI VOUCHER_CUSTOM: 'true' # Enable/disable the Web UI SERVICE_WEB: 'true' # Enable/disable the API SERVICE_API: 'false' # Enable/disable the printers and setup available printers, currently supported: pdf,escpos ip (Example: pdf,192.168.1.10) PRINTERS: '' # SMTP Mail from email address (optional) SMTP_FROM: 'mail@address.com' # SMTP Mail server hostname/ip (optional) SMTP_HOST: 'SMTP-Host-IP' # SMTP Mail server port (optional) SMTP_PORT: '25' # SMTP Mail use TLS? (optional) SMTP_SECURE: 'false' # SMTP Mail username (optional) SMTP_USERNAME: '' # SMTP Mail password (optional) SMTP_PASSWORD: '' # Enable/disable the kiosk page on /kiosk KIOSK_ENABLED: 'true' # Kiosk Voucher Type, format: expiration in minutes (required),single-use or multi-use vouchers value - '0' is for multi-use (unlimited) - '1' is for single-use - 'N' is for multi-use (Nx) (optional),upload speed limit in kbps (optional),download speed limit in kbps (optional),data transfer limit in MB (optional) # To skip a parameter just but nothing in between the comma's KIOSK_VOUCHER_TYPE: '480,1,,,;1440,1,,,;2880,1,,,;20160,N2,,,;' # Sets the application Log Level (Valid Options: error|warn|info|debug|trace) LOG_LEVEL: 'info' # Sets the default translation for dropdowns TRANSLATION_DEFAULT: 'de' # Enables/disables translation debugging, when enabled only translation keys are shown TRANSLATION_DEBUG: 'false' Thank you for your fast replay
Author
Owner

@glenndehaan commented on GitHub (Jun 20, 2025):

Hi @kamikaze2508,

Thank you for sharing I found the issue if you replace: 480,1,,,;1440,1,,,;2880,1,,,;20160,N2,,,; with 480,1,,,;1440,1,,,;2880,1,,,;20160,2,,,; within VOUCHER_TYPES you should be good to go.

Kind regards,
Glenn de Haan

<!-- gh-comment-id:2990510843 --> @glenndehaan commented on GitHub (Jun 20, 2025): Hi @kamikaze2508, Thank you for sharing I found the issue if you replace: `480,1,,,;1440,1,,,;2880,1,,,;20160,N2,,,;` with `480,1,,,;1440,1,,,;2880,1,,,;20160,2,,,;` within `VOUCHER_TYPES` you should be good to go. Kind regards, Glenn de Haan
Author
Owner

@kamikaze2508 commented on GitHub (Jun 20, 2025):

Perfect, that's it.

One quick question. Is the admin UI also multilingual? I entered "de" for TRANSLATION_DEFAULT in the YAML, but the UI is still in English.

<!-- gh-comment-id:2990596612 --> @kamikaze2508 commented on GitHub (Jun 20, 2025): Perfect, that's it. One quick question. Is the admin UI also multilingual? I entered "de" for TRANSLATION_DEFAULT in the YAML, but the UI is still in English.
Author
Owner

@glenndehaan commented on GitHub (Jun 20, 2025):

Great to hear. No the admin UI is only available in English. The idea is to change this in the future but is not on the planning right now

<!-- gh-comment-id:2990722181 --> @glenndehaan commented on GitHub (Jun 20, 2025): Great to hear. No the admin UI is only available in English. The idea is to change this in the future but is not on the planning right now
Author
Owner

@kamikaze2508 commented on GitHub (Jun 20, 2025):

OK, then it's fine. Thanks again for your quick help.
Best regards,
Christian

<!-- gh-comment-id:2990735447 --> @kamikaze2508 commented on GitHub (Jun 20, 2025): OK, then it's fine. Thanks again for your quick help. Best regards, Christian
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/unifi-voucher-site#31
No description provided.