[GH-ISSUE #3377] Blank Admin v2 interface #1843

Closed
opened 2026-02-27 11:19:26 +03:00 by kerem · 37 comments
Owner

Originally created by @olaf7 on GitHub (Dec 19, 2024).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3377

After upgrading to 2.3.0 on Debian Bookworm virtualenv manual installation using MariaDB, Nginx, Supervisor, gunicornL
I can login to the v1 admin panel. It provides a button to open the v2 interface. When I open this link in a new window on Chromium I get a blank screen (in settings.py Debug is enabled). When I check using developer tools and record the reload I get:

new-admin/:6 <link rel=preload> has an unsupported `type` value
localhost/api/o/.well-known/openid-configuration:1 
        
        
       Failed to load resource: net::ERR_CONNECTION_REFUSED
index-Dm6Rkjhz.js:26 Error: Unable to preload CSS for /new-admin/assets/VMenu-BSzGr_ci.css
    at HTMLLinkElement.<anonymous> (index-Dm6Rkjhz.js:22:2327)
wt @ index-Dm6Rkjhz.js:26
index-Dm6Rkjhz.js:33 
        
        
       Uncaught (in promise) TypeError: Failed to fetch
    at Kl.fetchWithTimeout (index-Dm6Rkjhz.js:33:52479)
    at Kl.getJson (index-Dm6Rkjhz.js:33:52999)
    at Aw.getMetadata (index-Dm6Rkjhz.js:33:56127)
    at Aw._getMetadataProperty (index-Dm6Rkjhz.js:33:57057)
    at Aw.getAuthorizationEndpoint (index-Dm6Rkjhz.js:33:56427)
    at zw.createSigninRequest (index-Dm6Rkjhz.js:33:75652)
    at Zw._signinStart (index-Dm6Rkjhz.js:33:98668)
    at Zw.signinRedirect (index-Dm6Rkjhz.js:33:93879)
index-Dm6Rkjhz.js:22 Uncaught (in promise) Error: Unable to preload CSS for /new-admin/assets/VToolbar-BVnJSNDw.css
    at HTMLLinkElement.<anonymous> (index-Dm6Rkjhz.js:22:2327)
6The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
new-admin/:6 <link rel=preload> has an unsupported `type` value
Navigated to https://modoboa.example.net/new-admin/
index-Dm6Rkjhz.js:33 
        
        
       GET https://localhost/api/o/.well-known/openid-configuration net::ERR_CONNECTION_REFUSED
fetchWithTimeout @ index-Dm6Rkjhz.js:33
getJson @ index-Dm6Rkjhz.js:33
getMetadata @ index-Dm6Rkjhz.js:33
_getMetadataProperty @ index-Dm6Rkjhz.js:33
getAuthorizationEndpoint @ index-Dm6Rkjhz.js:33
createSigninRequest @ index-Dm6Rkjhz.js:33
_signinStart @ index-Dm6Rkjhz.js:33
signinRedirect @ index-Dm6Rkjhz.js:33
await in signinRedirect
W @ index-Dm6Rkjhz.js:38
await in W
(anonymous) @ index-Dm6Rkjhz.js:30
(anonymous) @ index-Dm6Rkjhz.js:38
await in (anonymous)
(anonymous) @ index-Dm6Rkjhz.js:26
f @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
runWithContext @ index-Dm6Rkjhz.js:14
le @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:26
Qe @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
Promise.then
we @ index-Dm6Rkjhz.js:26
de @ index-Dm6Rkjhz.js:26
de @ index-Dm6Rkjhz.js:26
Q @ index-Dm6Rkjhz.js:26
install @ index-Dm6Rkjhz.js:26
use @ index-Dm6Rkjhz.js:14
DA @ index-Dm6Rkjhz.js:740
(anonymous) @ index-Dm6Rkjhz.js:740
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:740
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:740
index-Dm6Rkjhz.js:26 Error: Unable to preload CSS for /new-admin/assets/VApp-CAg9RG4k.css
    at HTMLLinkElement.<anonymous> (index-Dm6Rkjhz.js:22:2327)
wt @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
Promise.catch
de @ index-Dm6Rkjhz.js:26
de @ index-Dm6Rkjhz.js:26
Q @ index-Dm6Rkjhz.js:26
install @ index-Dm6Rkjhz.js:26
use @ index-Dm6Rkjhz.js:14
DA @ index-Dm6Rkjhz.js:740
(anonymous) @ index-Dm6Rkjhz.js:740
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:740
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:740
index-Dm6Rkjhz.js:33 
        
        
       Uncaught (in promise) TypeError: Failed to fetch
    at Kl.fetchWithTimeout (index-Dm6Rkjhz.js:33:52479)
    at Kl.getJson (index-Dm6Rkjhz.js:33:52999)
    at Aw.getMetadata (index-Dm6Rkjhz.js:33:56127)
    at Aw._getMetadataProperty (index-Dm6Rkjhz.js:33:57057)
    at Aw.getAuthorizationEndpoint (index-Dm6Rkjhz.js:33:56427)
    at zw.createSigninRequest (index-Dm6Rkjhz.js:33:75652)
    at Zw._signinStart (index-Dm6Rkjhz.js:33:98668)
    at Zw.signinRedirect (index-Dm6Rkjhz.js:33:93879)
fetchWithTimeout @ index-Dm6Rkjhz.js:33
getJson @ index-Dm6Rkjhz.js:33
getMetadata @ index-Dm6Rkjhz.js:33
_getMetadataProperty @ index-Dm6Rkjhz.js:33
getAuthorizationEndpoint @ index-Dm6Rkjhz.js:33
createSigninRequest @ index-Dm6Rkjhz.js:33
_signinStart @ index-Dm6Rkjhz.js:33
signinRedirect @ index-Dm6Rkjhz.js:33
await in signinRedirect
W @ index-Dm6Rkjhz.js:38
await in W
(anonymous) @ index-Dm6Rkjhz.js:30
(anonymous) @ index-Dm6Rkjhz.js:38
await in (anonymous)
(anonymous) @ index-Dm6Rkjhz.js:26
f @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
runWithContext @ index-Dm6Rkjhz.js:14
le @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:26
Qe @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
Promise.then
we @ index-Dm6Rkjhz.js:26
de @ index-Dm6Rkjhz.js:26
de @ index-Dm6Rkjhz.js:26
Q @ index-Dm6Rkjhz.js:26
install @ index-Dm6Rkjhz.js:26
use @ index-Dm6Rkjhz.js:14
DA @ index-Dm6Rkjhz.js:740
(anonymous) @ index-Dm6Rkjhz.js:740
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:740
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:740
index-Dm6Rkjhz.js:22 Uncaught (in promise) Error: Unable to preload CSS for /new-admin/assets/VAlert-CboFb8ND.css
    at HTMLLinkElement.<anonymous> (index-Dm6Rkjhz.js:22:2327)
(anonymous) @ index-Dm6Rkjhz.js:22
error
(anonymous) @ index-Dm6Rkjhz.js:22
(anonymous) @ index-Dm6Rkjhz.js:22
et @ index-Dm6Rkjhz.js:22
component @ index-Dm6Rkjhz.js:38
ao @ index-Dm6Rkjhz.js:26
(anonymous) @ index-Dm6Rkjhz.js:26
Promise.then
we @ index-Dm6Rkjhz.js:26
de @ index-Dm6Rkjhz.js:26
de @ index-Dm6Rkjhz.js:26
Q @ index-Dm6Rkjhz.js:26
install @ index-Dm6Rkjhz.js:26
use @ index-Dm6Rkjhz.js:14
DA @ index-Dm6Rkjhz.js:740
(anonymous) @ index-Dm6Rkjhz.js:740
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:740
Promise.then
(anonymous) @ index-Dm6Rkjhz.js:740
new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-PXm3-2wK.woff was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-B7mPwVP_.ttf was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
Originally created by @olaf7 on GitHub (Dec 19, 2024). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3377 After upgrading to 2.3.0 on Debian Bookworm virtualenv manual installation using MariaDB, Nginx, Supervisor, gunicornL I can login to the v1 admin panel. It provides a button to open the v2 interface. When I open this link in a new window on Chromium I get a blank screen (in settings.py Debug is enabled). When I check using developer tools and record the reload I get: ``` new-admin/:6 <link rel=preload> has an unsupported `type` value localhost/api/o/.well-known/openid-configuration:1 Failed to load resource: net::ERR_CONNECTION_REFUSED index-Dm6Rkjhz.js:26 Error: Unable to preload CSS for /new-admin/assets/VMenu-BSzGr_ci.css at HTMLLinkElement.<anonymous> (index-Dm6Rkjhz.js:22:2327) wt @ index-Dm6Rkjhz.js:26 index-Dm6Rkjhz.js:33 Uncaught (in promise) TypeError: Failed to fetch at Kl.fetchWithTimeout (index-Dm6Rkjhz.js:33:52479) at Kl.getJson (index-Dm6Rkjhz.js:33:52999) at Aw.getMetadata (index-Dm6Rkjhz.js:33:56127) at Aw._getMetadataProperty (index-Dm6Rkjhz.js:33:57057) at Aw.getAuthorizationEndpoint (index-Dm6Rkjhz.js:33:56427) at zw.createSigninRequest (index-Dm6Rkjhz.js:33:75652) at Zw._signinStart (index-Dm6Rkjhz.js:33:98668) at Zw.signinRedirect (index-Dm6Rkjhz.js:33:93879) index-Dm6Rkjhz.js:22 Uncaught (in promise) Error: Unable to preload CSS for /new-admin/assets/VToolbar-BVnJSNDw.css at HTMLLinkElement.<anonymous> (index-Dm6Rkjhz.js:22:2327) 6The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. new-admin/:6 <link rel=preload> has an unsupported `type` value Navigated to https://modoboa.example.net/new-admin/ index-Dm6Rkjhz.js:33 GET https://localhost/api/o/.well-known/openid-configuration net::ERR_CONNECTION_REFUSED fetchWithTimeout @ index-Dm6Rkjhz.js:33 getJson @ index-Dm6Rkjhz.js:33 getMetadata @ index-Dm6Rkjhz.js:33 _getMetadataProperty @ index-Dm6Rkjhz.js:33 getAuthorizationEndpoint @ index-Dm6Rkjhz.js:33 createSigninRequest @ index-Dm6Rkjhz.js:33 _signinStart @ index-Dm6Rkjhz.js:33 signinRedirect @ index-Dm6Rkjhz.js:33 await in signinRedirect W @ index-Dm6Rkjhz.js:38 await in W (anonymous) @ index-Dm6Rkjhz.js:30 (anonymous) @ index-Dm6Rkjhz.js:38 await in (anonymous) (anonymous) @ index-Dm6Rkjhz.js:26 f @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 runWithContext @ index-Dm6Rkjhz.js:14 le @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 Promise.then (anonymous) @ index-Dm6Rkjhz.js:26 Qe @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 Promise.then we @ index-Dm6Rkjhz.js:26 de @ index-Dm6Rkjhz.js:26 de @ index-Dm6Rkjhz.js:26 Q @ index-Dm6Rkjhz.js:26 install @ index-Dm6Rkjhz.js:26 use @ index-Dm6Rkjhz.js:14 DA @ index-Dm6Rkjhz.js:740 (anonymous) @ index-Dm6Rkjhz.js:740 Promise.then (anonymous) @ index-Dm6Rkjhz.js:740 Promise.then (anonymous) @ index-Dm6Rkjhz.js:740 index-Dm6Rkjhz.js:26 Error: Unable to preload CSS for /new-admin/assets/VApp-CAg9RG4k.css at HTMLLinkElement.<anonymous> (index-Dm6Rkjhz.js:22:2327) wt @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 Promise.catch de @ index-Dm6Rkjhz.js:26 de @ index-Dm6Rkjhz.js:26 Q @ index-Dm6Rkjhz.js:26 install @ index-Dm6Rkjhz.js:26 use @ index-Dm6Rkjhz.js:14 DA @ index-Dm6Rkjhz.js:740 (anonymous) @ index-Dm6Rkjhz.js:740 Promise.then (anonymous) @ index-Dm6Rkjhz.js:740 Promise.then (anonymous) @ index-Dm6Rkjhz.js:740 index-Dm6Rkjhz.js:33 Uncaught (in promise) TypeError: Failed to fetch at Kl.fetchWithTimeout (index-Dm6Rkjhz.js:33:52479) at Kl.getJson (index-Dm6Rkjhz.js:33:52999) at Aw.getMetadata (index-Dm6Rkjhz.js:33:56127) at Aw._getMetadataProperty (index-Dm6Rkjhz.js:33:57057) at Aw.getAuthorizationEndpoint (index-Dm6Rkjhz.js:33:56427) at zw.createSigninRequest (index-Dm6Rkjhz.js:33:75652) at Zw._signinStart (index-Dm6Rkjhz.js:33:98668) at Zw.signinRedirect (index-Dm6Rkjhz.js:33:93879) fetchWithTimeout @ index-Dm6Rkjhz.js:33 getJson @ index-Dm6Rkjhz.js:33 getMetadata @ index-Dm6Rkjhz.js:33 _getMetadataProperty @ index-Dm6Rkjhz.js:33 getAuthorizationEndpoint @ index-Dm6Rkjhz.js:33 createSigninRequest @ index-Dm6Rkjhz.js:33 _signinStart @ index-Dm6Rkjhz.js:33 signinRedirect @ index-Dm6Rkjhz.js:33 await in signinRedirect W @ index-Dm6Rkjhz.js:38 await in W (anonymous) @ index-Dm6Rkjhz.js:30 (anonymous) @ index-Dm6Rkjhz.js:38 await in (anonymous) (anonymous) @ index-Dm6Rkjhz.js:26 f @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 runWithContext @ index-Dm6Rkjhz.js:14 le @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 Promise.then (anonymous) @ index-Dm6Rkjhz.js:26 Qe @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 Promise.then we @ index-Dm6Rkjhz.js:26 de @ index-Dm6Rkjhz.js:26 de @ index-Dm6Rkjhz.js:26 Q @ index-Dm6Rkjhz.js:26 install @ index-Dm6Rkjhz.js:26 use @ index-Dm6Rkjhz.js:14 DA @ index-Dm6Rkjhz.js:740 (anonymous) @ index-Dm6Rkjhz.js:740 Promise.then (anonymous) @ index-Dm6Rkjhz.js:740 Promise.then (anonymous) @ index-Dm6Rkjhz.js:740 index-Dm6Rkjhz.js:22 Uncaught (in promise) Error: Unable to preload CSS for /new-admin/assets/VAlert-CboFb8ND.css at HTMLLinkElement.<anonymous> (index-Dm6Rkjhz.js:22:2327) (anonymous) @ index-Dm6Rkjhz.js:22 error (anonymous) @ index-Dm6Rkjhz.js:22 (anonymous) @ index-Dm6Rkjhz.js:22 et @ index-Dm6Rkjhz.js:22 component @ index-Dm6Rkjhz.js:38 ao @ index-Dm6Rkjhz.js:26 (anonymous) @ index-Dm6Rkjhz.js:26 Promise.then we @ index-Dm6Rkjhz.js:26 de @ index-Dm6Rkjhz.js:26 de @ index-Dm6Rkjhz.js:26 Q @ index-Dm6Rkjhz.js:26 install @ index-Dm6Rkjhz.js:26 use @ index-Dm6Rkjhz.js:14 DA @ index-Dm6Rkjhz.js:740 (anonymous) @ index-Dm6Rkjhz.js:740 Promise.then (anonymous) @ index-Dm6Rkjhz.js:740 Promise.then (anonymous) @ index-Dm6Rkjhz.js:740 new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-PXm3-2wK.woff was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-B7mPwVP_.ttf was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. ```
kerem 2026-02-27 11:19:26 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@tonioo commented on GitHub (Dec 20, 2024):

@olaf7 Can you check the content of the config.json file ?

<!-- gh-comment-id:2556479548 --> @tonioo commented on GitHub (Dec 20, 2024): @olaf7 Can you check the content of the config.json file ?
Author
Owner

@olaf7 commented on GitHub (Dec 20, 2024):

The confg.json in env/instance :

{ "API_BASE_URL": "https://modoboa.example.net/api/v2/" }

<!-- gh-comment-id:2556962550 --> @olaf7 commented on GitHub (Dec 20, 2024): The confg.json in env/instance : `{ "API_BASE_URL": "https://modoboa.example.net/api/v2/" } `
Author
Owner

@tonioo commented on GitHub (Dec 20, 2024):

I think you forgot some steps during the upgrade process. You should have more settings in this file

<!-- gh-comment-id:2557089688 --> @tonioo commented on GitHub (Dec 20, 2024): I think you forgot some steps during the upgrade process. You should have more settings in this file
Author
Owner

@olaf7 commented on GitHub (Dec 20, 2024):

After reviewing again I can think of no step I might have forgotten. Which one(s) spring to mind?

<!-- gh-comment-id:2557312794 --> @olaf7 commented on GitHub (Dec 20, 2024): After reviewing again I can think of no step I might have forgotten. Which one(s) spring to mind?
Author
Owner

@olaf7 commented on GitHub (Dec 20, 2024):

Only thing noticeable is a warning when issuing check --deploy :
?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_REFERRER_POLICY, SECURE_CROSS_ORIGIN_OPENER_POLICY, and SECURE_SSL_REDIRECT settings will have no effect.

But the middleware definition is a copy/paste from the upgrade instructions.

<!-- gh-comment-id:2557450789 --> @olaf7 commented on GitHub (Dec 20, 2024): Only thing noticeable is a warning when issuing check --deploy : ?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_REFERRER_POLICY, SECURE_CROSS_ORIGIN_OPENER_POLICY, and SECURE_SSL_REDIRECT settings will have no effect. But the middleware definition is a copy/paste from the upgrade instructions.
Author
Owner

@tonioo commented on GitHub (Dec 20, 2024):

Did you run those ones:
https://modoboa.readthedocs.io/en/latest/upgrade.html#post-upgrade-commands
?

<!-- gh-comment-id:2557457750 --> @tonioo commented on GitHub (Dec 20, 2024): Did you run those ones: https://modoboa.readthedocs.io/en/latest/upgrade.html#post-upgrade-commands ?
Author
Owner

@olaf7 commented on GitHub (Dec 20, 2024):

Yes I did

<!-- gh-comment-id:2557510737 --> @olaf7 commented on GitHub (Dec 20, 2024): Yes I did
Author
Owner

@olaf7 commented on GitHub (Dec 20, 2024):

When I run the upgrade process on another Modoboa (test) instance I get an error in the upgrade process:

python manage.py check --deploy

__all__: ['You must set OIDC_RSA_PRIVATE_KEY to use RSA algorithm']

(which can be fixed by applying the changes as suggested next in the update documentation)

after the following migrations:

admin.0022_alter_alarm_domain... OK
admin_0023_auto_20240320_1037... OK
core.0027_alter_user_language... OK
core.0028_userfidokeys... OK
core_0029_rename_tfa_enabled_user_totp_enabled_and_more... OK
oauth2_provider.0001_initial... OK
oauth2_provider.0002_auto_20190406_1805... OK
oauth2_provider.0003_auto_20201211_1214... OK
oauth2_provider.0004_auto_20200902_2022... OK
oauth2_provider.0005_auto_20211222_2352... OK
oauth2_provider.0006_alter_application_client_secret... OK
oauth2_provider.0007_application_post_logon_redirect_uris... OK
oauth2_provider.0008_alter_accesstoken_token... OK
oauth2_provider.0009_add_hash_client_secret... OK
oauth2_provider.0010_application_allowed_origins... OK
oauth2_provider.0011_refreshtoken_token_family... OK
oauth2_provider.0012_add_token_checksum... OK
otp_static.0003_add_timestamps... OK
otp_totp.0003_add_timestamps... OK
postfix_autoreply.0009_auto_20220926_0913... OK
postfix_autoreply.0010_auto_20230421_1825... OK

The Modoboa instance that I am trying to get working (and which is the one I am reporting about) however says:

Operations to perform:
  Apply all migrations: admin, auth, authtoken, contenttypes, core, django_rq, dmarc, dnstools, imap_migration, lib, limits, maillog, modoboa_amavis, modoboa_contacts, modoboa_radicale, oauth2_provider, otp_static, otp_totp, postfix_autoreply, relaydomains, reversion, sessions, sites, transport
Running migrations:
  No migrations to apply.

So it seems the oauth2_provider migration is fully applied, but the oauth settings in config.json are missing.

<!-- gh-comment-id:2557884071 --> @olaf7 commented on GitHub (Dec 20, 2024): When I run the upgrade process on another Modoboa (test) instance I get an error in the upgrade process: ``` python manage.py check --deploy __all__: ['You must set OIDC_RSA_PRIVATE_KEY to use RSA algorithm'] ``` (which can be fixed by applying the changes as suggested next in the update documentation) after the following migrations: ``` admin.0022_alter_alarm_domain... OK admin_0023_auto_20240320_1037... OK core.0027_alter_user_language... OK core.0028_userfidokeys... OK core_0029_rename_tfa_enabled_user_totp_enabled_and_more... OK oauth2_provider.0001_initial... OK oauth2_provider.0002_auto_20190406_1805... OK oauth2_provider.0003_auto_20201211_1214... OK oauth2_provider.0004_auto_20200902_2022... OK oauth2_provider.0005_auto_20211222_2352... OK oauth2_provider.0006_alter_application_client_secret... OK oauth2_provider.0007_application_post_logon_redirect_uris... OK oauth2_provider.0008_alter_accesstoken_token... OK oauth2_provider.0009_add_hash_client_secret... OK oauth2_provider.0010_application_allowed_origins... OK oauth2_provider.0011_refreshtoken_token_family... OK oauth2_provider.0012_add_token_checksum... OK otp_static.0003_add_timestamps... OK otp_totp.0003_add_timestamps... OK postfix_autoreply.0009_auto_20220926_0913... OK postfix_autoreply.0010_auto_20230421_1825... OK ``` The Modoboa instance that I am trying to get working (and which is the one I am reporting about) however says: ``` Operations to perform: Apply all migrations: admin, auth, authtoken, contenttypes, core, django_rq, dmarc, dnstools, imap_migration, lib, limits, maillog, modoboa_amavis, modoboa_contacts, modoboa_radicale, oauth2_provider, otp_static, otp_totp, postfix_autoreply, relaydomains, reversion, sessions, sites, transport Running migrations: No migrations to apply. ``` So it seems the oauth2_provider migration is fully applied, but the oauth settings in config.json are missing.
Author
Owner

@Spitfireap commented on GitHub (Dec 21, 2024):

@olaf7, the command that populates config.json is this one if I remember correctly : python manage.py load_initial_data

<!-- gh-comment-id:2558164025 --> @Spitfireap commented on GitHub (Dec 21, 2024): @olaf7, the command that populates config.json is this one if I remember correctly : `python manage.py load_initial_data`
Author
Owner

@olaf7 commented on GitHub (Dec 21, 2024):

@Spitfireap I reapplied that command (again) and sadly the config.json file still only has 1 URI definition in it. Any way I can debug this?

Only output I got is:

python manage.py load_initial_data
System check identified some issues:

WARNINGS:
?: (ckeditor.W001) django-ckeditor bundles CKEditor 4.22.1 which isn't supported anmyore and which does have unfixed security issues, see for example https://ckeditor.com/cke4/release/CKEditor-4.24.0-LTS . You should consider strongly switching to a different editor (maybe CKEditor 5 respectively django-ckeditor-5 after checking whether the CKEditor 5 license terms work for you) or switch to the non-free CKEditor 4 LTS package. See https://ckeditor.com/ckeditor-4-support/ for more on this. (Note! This notice has been added by the django-ckeditor developers and we are not affiliated with CKSource and were not involved in the licensing change, so please refrain from complaining to us. Thanks.)
<!-- gh-comment-id:2558218434 --> @olaf7 commented on GitHub (Dec 21, 2024): @Spitfireap I reapplied that command (again) and sadly the config.json file still only has 1 URI definition in it. Any way I can debug this? Only output I got is: ``` python manage.py load_initial_data System check identified some issues: WARNINGS: ?: (ckeditor.W001) django-ckeditor bundles CKEditor 4.22.1 which isn't supported anmyore and which does have unfixed security issues, see for example https://ckeditor.com/cke4/release/CKEditor-4.24.0-LTS . You should consider strongly switching to a different editor (maybe CKEditor 5 respectively django-ckeditor-5 after checking whether the CKEditor 5 license terms work for you) or switch to the non-free CKEditor 4 LTS package. See https://ckeditor.com/ckeditor-4-support/ for more on this. (Note! This notice has been added by the django-ckeditor developers and we are not affiliated with CKSource and were not involved in the licensing change, so please refrain from complaining to us. Thanks.) ```
Author
Owner

@olaf7 commented on GitHub (Dec 31, 2024):

I tried to run the command again with --verbosity=3 but that did not provide more output, so I am stuck.

<!-- gh-comment-id:2566745060 --> @olaf7 commented on GitHub (Dec 31, 2024): I tried to run the command again with --verbosity=3 but that did not provide more output, so I am stuck.
Author
Owner

@tonioo commented on GitHub (Jan 16, 2025):

If the load_initial_data command completes, your config.json file should contain more than what you see. Are you sure you're running latest modoboa version?

<!-- gh-comment-id:2595077103 --> @tonioo commented on GitHub (Jan 16, 2025): If the load_initial_data command completes, your config.json file should contain more than what you see. Are you sure you're running latest modoboa version?
Author
Owner

@olaf7 commented on GitHub (Jan 16, 2025):

Yes, I am sure. Just double checked: 2.3.0
Reapplying the command does unfortunately not fix/extend the json file.

<!-- gh-comment-id:2595760017 --> @olaf7 commented on GitHub (Jan 16, 2025): Yes, I am sure. Just double checked: 2.3.0 Reapplying the command does unfortunately not fix/extend the json file.
Author
Owner

@tonioo commented on GitHub (Jan 16, 2025):

Could you try with 2.3.4?

<!-- gh-comment-id:2595893052 --> @tonioo commented on GitHub (Jan 16, 2025): Could you try with 2.3.4?
Author
Owner

@olaf7 commented on GitHub (Jan 17, 2025):

Done. Unfortunately the confg.json file still has only 1 definition in it as before. (no changes)

<!-- gh-comment-id:2599332897 --> @olaf7 commented on GitHub (Jan 17, 2025): Done. Unfortunately the confg.json file still has only 1 definition in it as before. (no changes)
Author
Owner

@tonioo commented on GitHub (Jan 21, 2025):

Can you check if you find another frontend/ folder within /srv/modoboa ?

<!-- gh-comment-id:2604120923 --> @tonioo commented on GitHub (Jan 21, 2025): Can you check if you find another frontend/ folder within /srv/modoboa ?
Author
Owner

@olaf7 commented on GitHub (Jan 21, 2025):

Ah. It appears there are two config.json files on my system. One in the modoboa root directory holding just the api_base_url and one in a subdirectory called 'frontend' having also 4 oauth_ settings in it. Problem persist though.
Note all URIs refer to localhost. Is this as it should be?

<!-- gh-comment-id:2605608933 --> @olaf7 commented on GitHub (Jan 21, 2025): Ah. It appears there are two config.json files on my system. One in the modoboa root directory holding just the api_base_url and one in a subdirectory called 'frontend' having also 4 oauth_ settings in it. Problem persist though. Note all URIs refer to localhost. Is this as it should be?
Author
Owner

@tonioo commented on GitHub (Jan 22, 2025):

Yes for URIs. Now, you need to update nginx configuration and tell it to use this new folder you found instead of the old one.

<!-- gh-comment-id:2606559724 --> @tonioo commented on GitHub (Jan 22, 2025): Yes for URIs. Now, you need to update nginx configuration and tell it to use this new folder you found instead of the old one.
Author
Owner

@olaf7 commented on GitHub (Jan 22, 2025):

Great. I thought so too, but that makes me wonder...
Did something go wrong somehow and are files placed at a wrong location? If so that will likely have impact on future updates.
Also: the v1 admin panel works fine. The v2 starts to load and then fails, so I assume it is not just a rewrite rule for 'new-admin'?
I will give this a spin asap

<!-- gh-comment-id:2606914000 --> @olaf7 commented on GitHub (Jan 22, 2025): Great. I thought so too, but that makes me wonder... Did something go wrong somehow and are files placed at a wrong location? If so that will likely have impact on future updates. Also: the v1 admin panel works fine. The v2 starts to load and then fails, so I assume it is not just a rewrite rule for 'new-admin'? I will give this a spin asap
Author
Owner

@olaf7 commented on GitHub (Jan 22, 2025):

I am not sure what to rewrite. I double checked my nginx config and compared it to what the installer would produce. I also rechecked the output of Developer Tools, but it remains as reported above. I also checked nginx logs and supervisor and gunicorn logs, but I see no errors in these.
The errors (see above) mention localhost. Again no errors in the main nginx logs.
Happy about the extended config, but still stuck.

<!-- gh-comment-id:2608019791 --> @olaf7 commented on GitHub (Jan 22, 2025): I am not sure what to rewrite. I double checked my nginx config and compared it to what the installer would produce. I also rechecked the output of Developer Tools, but it remains as reported above. I also checked nginx logs and supervisor and gunicorn logs, but I see no errors in these. The errors (see above) mention localhost. Again no errors in the main nginx logs. Happy about the extended config, but still stuck.
Author
Owner

@tonioo commented on GitHub (Jan 23, 2025):

The difference with path might be the result of a confusion in the upgrade instructions of the documentation... But it's safe to keep the version deployed by the management command.
Could you paste the error you see now? And do you any reference to localhost in config.json file?

<!-- gh-comment-id:2609204194 --> @tonioo commented on GitHub (Jan 23, 2025): The difference with path might be the result of a confusion in the upgrade instructions of the documentation... But it's safe to keep the version deployed by the management command. Could you paste the error you see now? And do you any reference to localhost in config.json file?
Author
Owner

@olaf7 commented on GitHub (Jan 23, 2025):

Note: previously the v2 admin interface used to work,
For sake of completeness:

nginx config snipit:

`

 location ^~ /new-admin {
          alias  /srv/modoboa/env/instance/frontend/;
          index  index.html;

          expires -1;
          add_header Pragma "no-cache";
          add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";

          try_files $uri $uri/ /index.html = 404;
  }

`

cat /srv/modoboa/env/instance/frontend/config.json

`

{
"API_BASE_URL": "https://localhost/api/v2",
"OAUTH_AUTHORITY_URL": "https://localhost/api/o",
"OAUTH_CLIENT_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"OAUTH_REDIRECT_URI": "https://localhost/new-admin/login/logged",
"OAUTH_POST_REDIRECT_URI": "https://localhost/new-admin"
}

`

No errors in logs or on screen (blank).
Output of Developer Tools in Chromium (and Firefox):

`

has an unsupported `type` value localhost/api/o/.well-known/openid-configuration:1
   Failed to load resource: net::ERR_CONNECTION_REFUSED

index-CyvlV96y.js:26 Error: Unable to preload CSS for /new-admin/assets/VApp-CAg9RG4k.css
at HTMLLinkElement. (index-CyvlV96y.js:22:2327)
wt @ index-CyvlV96y.js:26
index-CyvlV96y.js:38

   Uncaught (in promise) TypeError: Failed to fetch
at ic.fetchWithTimeout (index-CyvlV96y.js:38:69417)
at ic.getJson (index-CyvlV96y.js:38:69937)
at eS.getMetadata (index-CyvlV96y.js:38:73065)
at eS._getMetadataProperty (index-CyvlV96y.js:38:73995)
at eS.getAuthorizationEndpoint (index-CyvlV96y.js:38:73365)
at gS.createSigninRequest (index-CyvlV96y.js:38:92590)
at ES._signinStart (index-CyvlV96y.js:38:115606)
at ES.signinRedirect (index-CyvlV96y.js:38:110817)

index-CyvlV96y.js:22 Uncaught (in promise) Error: Unable to preload CSS for /new-admin/assets/VToolbar-BVnJSNDw.css
at HTMLLinkElement. (index-CyvlV96y.js:22:2327)
6The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
Navigated to https://modoboa.example.net/new-admin/
new-admin/:6 has an unsupported type value
index-CyvlV96y.js:38

   GET https://localhost/api/o/.well-known/openid-configuration net::ERR_CONNECTION_REFUSED

fetchWithTimeout @ index-CyvlV96y.js:38
getJson @ index-CyvlV96y.js:38
getMetadata @ index-CyvlV96y.js:38
_getMetadataProperty @ index-CyvlV96y.js:38
getAuthorizationEndpoint @ index-CyvlV96y.js:38
createSigninRequest @ index-CyvlV96y.js:38
_signinStart @ index-CyvlV96y.js:38
signinRedirect @ index-CyvlV96y.js:38
await in signinRedirect
W @ index-CyvlV96y.js:38
await in W
(anonymous) @ index-CyvlV96y.js:30
(anonymous) @ index-CyvlV96y.js:38
await in (anonymous)
(anonymous) @ index-CyvlV96y.js:26
f @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
runWithContext @ index-CyvlV96y.js:14
oe @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
Promise.then
(anonymous) @ index-CyvlV96y.js:26
Qe @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
Promise.then
ve @ index-CyvlV96y.js:26
ue @ index-CyvlV96y.js:26
ue @ index-CyvlV96y.js:26
J @ index-CyvlV96y.js:26
install @ index-CyvlV96y.js:26
use @ index-CyvlV96y.js:14
N1 @ index-CyvlV96y.js:740
(anonymous) @ index-CyvlV96y.js:740
Promise.then
(anonymous) @ index-CyvlV96y.js:740
Promise.then
(anonymous) @ index-CyvlV96y.js:740
index-CyvlV96y.js:26 Error: Unable to preload CSS for /new-admin/assets/VAvatar-BChM8Z-8.css
at HTMLLinkElement. (index-CyvlV96y.js:22:2327)
wt @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
Promise.catch
ue @ index-CyvlV96y.js:26
ue @ index-CyvlV96y.js:26
J @ index-CyvlV96y.js:26
install @ index-CyvlV96y.js:26
use @ index-CyvlV96y.js:14
N1 @ index-CyvlV96y.js:740
(anonymous) @ index-CyvlV96y.js:740
Promise.then
(anonymous) @ index-CyvlV96y.js:740
Promise.then
(anonymous) @ index-CyvlV96y.js:740
index-CyvlV96y.js:38

   Uncaught (in promise) TypeError: Failed to fetch
at ic.fetchWithTimeout (index-CyvlV96y.js:38:69417)
at ic.getJson (index-CyvlV96y.js:38:69937)
at eS.getMetadata (index-CyvlV96y.js:38:73065)
at eS._getMetadataProperty (index-CyvlV96y.js:38:73995)
at eS.getAuthorizationEndpoint (index-CyvlV96y.js:38:73365)
at gS.createSigninRequest (index-CyvlV96y.js:38:92590)
at ES._signinStart (index-CyvlV96y.js:38:115606)
at ES.signinRedirect (index-CyvlV96y.js:38:110817)

fetchWithTimeout @ index-CyvlV96y.js:38
getJson @ index-CyvlV96y.js:38
getMetadata @ index-CyvlV96y.js:38
_getMetadataProperty @ index-CyvlV96y.js:38
getAuthorizationEndpoint @ index-CyvlV96y.js:38
createSigninRequest @ index-CyvlV96y.js:38
signinStart @ index-CyvlV96y.js:38
signinRedirect @ index-CyvlV96y.js:38
await in signinRedirect
W @ index-CyvlV96y.js:38
await in W
(anonymous) @ index-CyvlV96y.js:30
(anonymous) @ index-CyvlV96y.js:38
await in (anonymous)
(anonymous) @ index-CyvlV96y.js:26
f @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
runWithContext @ index-CyvlV96y.js:14
oe @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
Promise.then
(anonymous) @ index-CyvlV96y.js:26
Qe @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
Promise.then
ve @ index-CyvlV96y.js:26
ue @ index-CyvlV96y.js:26
ue @ index-CyvlV96y.js:26
J @ index-CyvlV96y.js:26
install @ index-CyvlV96y.js:26
use @ index-CyvlV96y.js:14
N1 @ index-CyvlV96y.js:740
(anonymous) @ index-CyvlV96y.js:740
Promise.then
(anonymous) @ index-CyvlV96y.js:740
Promise.then
(anonymous) @ index-CyvlV96y.js:740
index-CyvlV96y.js:22 Uncaught (in promise) Error: Unable to preload CSS for /new-admin/assets/Dashboard-Cj5OLJ89.css
at HTMLLinkElement. (index-CyvlV96y.js:22:2327)
(anonymous) @ index-CyvlV96y.js:22
error
(anonymous) @ index-CyvlV96y.js:22
(anonymous) @ index-CyvlV96y.js:22
et @ index-CyvlV96y.js:22
component @ index-CyvlV96y.js:38
ro @ index-CyvlV96y.js:26
(anonymous) @ index-CyvlV96y.js:26
Promise.then
ve @ index-CyvlV96y.js:26
ue @ index-CyvlV96y.js:26
ue @ index-CyvlV96y.js:26
J @ index-CyvlV96y.js:26
install @ index-CyvlV96y.js:26
use @ index-CyvlV96y.js:14
N1 @ index-CyvlV96y.js:740
(anonymous) @ index-CyvlV96y.js:740
Promise.then
(anonymous) @ index-CyvlV96y.js:740
Promise.then
(anonymous) @ index-CyvlV96y.js:740
new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-PXm3-2wK.woff was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-B7mPwVP
.ttf was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

`

<!-- gh-comment-id:2609542333 --> @olaf7 commented on GitHub (Jan 23, 2025): Note: previously the v2 admin interface used to work, For sake of completeness: nginx config snipit: ` location ^~ /new-admin { alias /srv/modoboa/env/instance/frontend/; index index.html; expires -1; add_header Pragma "no-cache"; add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; try_files $uri $uri/ /index.html = 404; } ` cat /srv/modoboa/env/instance/frontend/config.json ` { "API_BASE_URL": "https://localhost/api/v2", "OAUTH_AUTHORITY_URL": "https://localhost/api/o", "OAUTH_CLIENT_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "OAUTH_REDIRECT_URI": "https://localhost/new-admin/login/logged", "OAUTH_POST_REDIRECT_URI": "https://localhost/new-admin" } ` No errors in logs or on screen (blank). Output of Developer Tools in Chromium (and Firefox): ` <link rel=preload> has an unsupported `type` value localhost/api/o/.well-known/openid-configuration:1 Failed to load resource: net::ERR_CONNECTION_REFUSED index-CyvlV96y.js:26 Error: Unable to preload CSS for /new-admin/assets/VApp-CAg9RG4k.css at HTMLLinkElement.<anonymous> (index-CyvlV96y.js:22:2327) wt @ index-CyvlV96y.js:26 index-CyvlV96y.js:38 Uncaught (in promise) TypeError: Failed to fetch at ic.fetchWithTimeout (index-CyvlV96y.js:38:69417) at ic.getJson (index-CyvlV96y.js:38:69937) at eS.getMetadata (index-CyvlV96y.js:38:73065) at eS._getMetadataProperty (index-CyvlV96y.js:38:73995) at eS.getAuthorizationEndpoint (index-CyvlV96y.js:38:73365) at gS.createSigninRequest (index-CyvlV96y.js:38:92590) at ES._signinStart (index-CyvlV96y.js:38:115606) at ES.signinRedirect (index-CyvlV96y.js:38:110817) index-CyvlV96y.js:22 Uncaught (in promise) Error: Unable to preload CSS for /new-admin/assets/VToolbar-BVnJSNDw.css at HTMLLinkElement.<anonymous> (index-CyvlV96y.js:22:2327) 6The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. Navigated to https://modoboa.example.net/new-admin/ new-admin/:6 <link rel=preload> has an unsupported `type` value index-CyvlV96y.js:38 GET https://localhost/api/o/.well-known/openid-configuration net::ERR_CONNECTION_REFUSED fetchWithTimeout @ index-CyvlV96y.js:38 getJson @ index-CyvlV96y.js:38 getMetadata @ index-CyvlV96y.js:38 _getMetadataProperty @ index-CyvlV96y.js:38 getAuthorizationEndpoint @ index-CyvlV96y.js:38 createSigninRequest @ index-CyvlV96y.js:38 _signinStart @ index-CyvlV96y.js:38 signinRedirect @ index-CyvlV96y.js:38 await in signinRedirect W @ index-CyvlV96y.js:38 await in W (anonymous) @ index-CyvlV96y.js:30 (anonymous) @ index-CyvlV96y.js:38 await in (anonymous) (anonymous) @ index-CyvlV96y.js:26 f @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 runWithContext @ index-CyvlV96y.js:14 oe @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 Promise.then (anonymous) @ index-CyvlV96y.js:26 Qe @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 Promise.then ve @ index-CyvlV96y.js:26 ue @ index-CyvlV96y.js:26 ue @ index-CyvlV96y.js:26 J @ index-CyvlV96y.js:26 install @ index-CyvlV96y.js:26 use @ index-CyvlV96y.js:14 N1 @ index-CyvlV96y.js:740 (anonymous) @ index-CyvlV96y.js:740 Promise.then (anonymous) @ index-CyvlV96y.js:740 Promise.then (anonymous) @ index-CyvlV96y.js:740 index-CyvlV96y.js:26 Error: Unable to preload CSS for /new-admin/assets/VAvatar-BChM8Z-8.css at HTMLLinkElement.<anonymous> (index-CyvlV96y.js:22:2327) wt @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 Promise.catch ue @ index-CyvlV96y.js:26 ue @ index-CyvlV96y.js:26 J @ index-CyvlV96y.js:26 install @ index-CyvlV96y.js:26 use @ index-CyvlV96y.js:14 N1 @ index-CyvlV96y.js:740 (anonymous) @ index-CyvlV96y.js:740 Promise.then (anonymous) @ index-CyvlV96y.js:740 Promise.then (anonymous) @ index-CyvlV96y.js:740 index-CyvlV96y.js:38 Uncaught (in promise) TypeError: Failed to fetch at ic.fetchWithTimeout (index-CyvlV96y.js:38:69417) at ic.getJson (index-CyvlV96y.js:38:69937) at eS.getMetadata (index-CyvlV96y.js:38:73065) at eS._getMetadataProperty (index-CyvlV96y.js:38:73995) at eS.getAuthorizationEndpoint (index-CyvlV96y.js:38:73365) at gS.createSigninRequest (index-CyvlV96y.js:38:92590) at ES._signinStart (index-CyvlV96y.js:38:115606) at ES.signinRedirect (index-CyvlV96y.js:38:110817) fetchWithTimeout @ index-CyvlV96y.js:38 getJson @ index-CyvlV96y.js:38 getMetadata @ index-CyvlV96y.js:38 _getMetadataProperty @ index-CyvlV96y.js:38 getAuthorizationEndpoint @ index-CyvlV96y.js:38 createSigninRequest @ index-CyvlV96y.js:38 _signinStart @ index-CyvlV96y.js:38 signinRedirect @ index-CyvlV96y.js:38 await in signinRedirect W @ index-CyvlV96y.js:38 await in W (anonymous) @ index-CyvlV96y.js:30 (anonymous) @ index-CyvlV96y.js:38 await in (anonymous) (anonymous) @ index-CyvlV96y.js:26 f @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 runWithContext @ index-CyvlV96y.js:14 oe @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 Promise.then (anonymous) @ index-CyvlV96y.js:26 Qe @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 Promise.then ve @ index-CyvlV96y.js:26 ue @ index-CyvlV96y.js:26 ue @ index-CyvlV96y.js:26 J @ index-CyvlV96y.js:26 install @ index-CyvlV96y.js:26 use @ index-CyvlV96y.js:14 N1 @ index-CyvlV96y.js:740 (anonymous) @ index-CyvlV96y.js:740 Promise.then (anonymous) @ index-CyvlV96y.js:740 Promise.then (anonymous) @ index-CyvlV96y.js:740 index-CyvlV96y.js:22 Uncaught (in promise) Error: Unable to preload CSS for /new-admin/assets/Dashboard-Cj5OLJ89.css at HTMLLinkElement.<anonymous> (index-CyvlV96y.js:22:2327) (anonymous) @ index-CyvlV96y.js:22 error (anonymous) @ index-CyvlV96y.js:22 (anonymous) @ index-CyvlV96y.js:22 et @ index-CyvlV96y.js:22 component @ index-CyvlV96y.js:38 ro @ index-CyvlV96y.js:26 (anonymous) @ index-CyvlV96y.js:26 Promise.then ve @ index-CyvlV96y.js:26 ue @ index-CyvlV96y.js:26 ue @ index-CyvlV96y.js:26 J @ index-CyvlV96y.js:26 install @ index-CyvlV96y.js:26 use @ index-CyvlV96y.js:14 N1 @ index-CyvlV96y.js:740 (anonymous) @ index-CyvlV96y.js:740 Promise.then (anonymous) @ index-CyvlV96y.js:740 Promise.then (anonymous) @ index-CyvlV96y.js:740 new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-PXm3-2wK.woff was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. new-admin/:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-B7mPwVP_.ttf was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. `
Author
Owner

@tonioo commented on GitHub (Jan 23, 2025):

You should not have reference to localhost in the config file, but your instance hostname instead.

<!-- gh-comment-id:2609659040 --> @tonioo commented on GitHub (Jan 23, 2025): You should not have reference to localhost in the config file, but your instance hostname instead.
Author
Owner

@olaf7 commented on GitHub (Jan 23, 2025):

After changing all localhost entries in frontend/config.json (which was generated, not edited) to modoboa.example.net I now get a new error:
Error: invalid_request
Mismatching redirect URI.
Which is a HTTP 400 reply on : https://modoboa.example.net/api/o/authorize/?client_id=etc

So, the URI seems right. Is there another location/configuration I should check which might have a reference to localhost? Or is the URI hased into the clientID or ....?

<!-- gh-comment-id:2609799172 --> @olaf7 commented on GitHub (Jan 23, 2025): After changing all localhost entries in frontend/config.json (which was generated, not edited) to modoboa.example.net I now get a new error: Error: invalid_request Mismatching redirect URI. Which is a HTTP 400 reply on : `https://modoboa.example.net/api/o/authorize/?client_id=etc` So, the URI seems right. Is there another location/configuration I should check which might have a reference to localhost? Or is the URI hased into the clientID or ....?
Author
Owner

@tonioo commented on GitHub (Jan 23, 2025):

Ok, then I think there is a issue in your DB. Could you check the content of the django_site table?

<!-- gh-comment-id:2610202626 --> @tonioo commented on GitHub (Jan 23, 2025): Ok, then I think there is a issue in your DB. Could you check the content of the django_site table?
Author
Owner

@olaf7 commented on GitHub (Jan 23, 2025):

Domain and Name fields are identical. They match the domainname of modoboa: modoboa.example.net

<!-- gh-comment-id:2610997027 --> @olaf7 commented on GitHub (Jan 23, 2025): Domain and Name fields are identical. They match the domainname of modoboa: modoboa.example.net
Author
Owner

@olaf7 commented on GitHub (Apr 9, 2025):

I just upgraded to 2.3.6 and the error persists, although visually I now get something different: a circle turning stating: attempting to log you on. This sounds as progress as before I needed manually to enter my credentials again, although I was already loged in on the v1 admin interface.

<link rel=preload> has an unsupported `type` value
localhost/api/o/.well-known/openid-configuration:1 
            
            
           Failed to load resource: net::ERR_CONNECTION_REFUSED

index-Bbkf9DIc.js:38 Error logging in: TypeError: Failed to fetch
    at Zl.fetchWithTimeout (index-Bbkf9DIc.js:38:69408)
    at Zl.getJson (index-Bbkf9DIc.js:38:69928)
    at Hk.getMetadata (index-Bbkf9DIc.js:38:73056)
    at Hk._getMetadataProperty (index-Bbkf9DIc.js:38:73986)
    at Hk.getAuthorizationEndpoint (index-Bbkf9DIc.js:38:73356)
    at eS.createSigninRequest (index-Bbkf9DIc.js:38:92581)
    at fS._signinStart (index-Bbkf9DIc.js:38:115597)
    at fS.signinRedirect (index-Bbkf9DIc.js:38:110808)
    at async Proxy.j (index-Bbkf9DIc.js:38:124787)
j @ index-Bbkf9DIc.js:38

6The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. hPlease make sure it has an appropriate `as` value and it is preloaded intentionally.

login:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

The last error line gets repeated a couple of times.

Any (new) ideas how to resolve this please?

<!-- gh-comment-id:2790785623 --> @olaf7 commented on GitHub (Apr 9, 2025): I just upgraded to 2.3.6 and the error persists, although visually I now get something different: a circle turning stating: attempting to log you on. This sounds as progress as before I needed manually to enter my credentials again, although I was already loged in on the v1 admin interface. ``` <link rel=preload> has an unsupported `type` value localhost/api/o/.well-known/openid-configuration:1 Failed to load resource: net::ERR_CONNECTION_REFUSED index-Bbkf9DIc.js:38 Error logging in: TypeError: Failed to fetch at Zl.fetchWithTimeout (index-Bbkf9DIc.js:38:69408) at Zl.getJson (index-Bbkf9DIc.js:38:69928) at Hk.getMetadata (index-Bbkf9DIc.js:38:73056) at Hk._getMetadataProperty (index-Bbkf9DIc.js:38:73986) at Hk.getAuthorizationEndpoint (index-Bbkf9DIc.js:38:73356) at eS.createSigninRequest (index-Bbkf9DIc.js:38:92581) at fS._signinStart (index-Bbkf9DIc.js:38:115597) at fS.signinRedirect (index-Bbkf9DIc.js:38:110808) at async Proxy.j (index-Bbkf9DIc.js:38:124787) j @ index-Bbkf9DIc.js:38 6The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event. hPlease make sure it has an appropriate `as` value and it is preloaded intentionally. login:1 The resource https://modoboa.example.net/new-admin/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. ``` The last error line gets repeated a couple of times. Any (new) ideas how to resolve this please?
Author
Owner

@olaf7 commented on GitHub (Apr 9, 2025):

Only other thing I noticed during the upgrade:

python manage.py check --deploy
System check identified some issues:

WARNINGS:
?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_REFERRER_POLICY, SECURE_CROSS_ORIGIN_OPENER_POLICY, and SECURE_SSL_REDIRECT settings will have no effect.

In the Nginx logs I see (as long as the windows is open): "GET /core/top_notifications/check/ HTTP/2.0" 200
The last log which does not give a HTTP 200: "GET /sitestatic/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0 HTTP/2.0" 304
Some 200s in front of that and a whole series of other 304s before those.
Hope this helps.

<!-- gh-comment-id:2791026238 --> @olaf7 commented on GitHub (Apr 9, 2025): Only other thing I noticed during the upgrade: ``` python manage.py check --deploy System check identified some issues: WARNINGS: ?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_REFERRER_POLICY, SECURE_CROSS_ORIGIN_OPENER_POLICY, and SECURE_SSL_REDIRECT settings will have no effect. ``` In the Nginx logs I see (as long as the windows is open): "GET /core/top_notifications/check/ HTTP/2.0" 200 The last log which does not give a HTTP 200: "GET /sitestatic/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0 HTTP/2.0" 304 Some 200s in front of that and a whole series of other 304s before those. Hope this helps.
Author
Owner

@tonioo commented on GitHub (Apr 11, 2025):

@olaf7 I can see this in your logs:
has an unsupported `type` value localhost/api/o/.well-known/openid-configuration
This should not be localhost but the complete hostname

<!-- gh-comment-id:2796464592 --> @tonioo commented on GitHub (Apr 11, 2025): @olaf7 I can see this in your logs: ```has an unsupported `type` value localhost/api/o/.well-known/openid-configuration``` This should not be localhost but the complete hostname
Author
Owner

@tonioo commented on GitHub (Apr 11, 2025):

Are you sure you only have on config.json file ?

<!-- gh-comment-id:2796465668 --> @tonioo commented on GitHub (Apr 11, 2025): Are you sure you only have on config.json file ?
Author
Owner

@olaf7 commented on GitHub (Apr 11, 2025):

Are you sure you only have on config.json file ?

No. I have two:
config.json with just 1 item: API_BASE_URL which contains the fqdn
The other one is in subdirectory "frontend" which contains: API_BASE_URL, OAUTH_AUTHORITY_URL, OAUTH_CLIENT_ID, OAUTH_REDIRECT_URI, OAUTH_POST_REDIRECT_URI.
The URI/URLs do not contain the fqdn but localhost in this file.
Do I need only one config.json? If so, where?

<!-- gh-comment-id:2797545243 --> @olaf7 commented on GitHub (Apr 11, 2025): > Are you sure you only have on config.json file ? No. I have two: config.json with just 1 item: API_BASE_URL which contains the fqdn The other one is in subdirectory "frontend" which contains: API_BASE_URL, OAUTH_AUTHORITY_URL, OAUTH_CLIENT_ID, OAUTH_REDIRECT_URI, OAUTH_POST_REDIRECT_URI. The URI/URLs do not contain the fqdn but localhost in this file. Do I need only one config.json? If so, where?
Author
Owner

@olaf7 commented on GitHub (Apr 11, 2025):

If I change "localhost" to the fqdn I get a HTTP 400 error: Error: invalid_request
Mismatching redirect URI.

<!-- gh-comment-id:2797824707 --> @olaf7 commented on GitHub (Apr 11, 2025): If I change "localhost" to the fqdn I get a HTTP 400 error: Error: invalid_request Mismatching redirect URI.
Author
Owner

@olaf7 commented on GitHub (Apr 11, 2025):

Basically I am back at Jan 23 in this issue: https://github.com/modoboa/modoboa/issues/3377#issuecomment-2609799172
When upgrading the config.json file gets regenerated and "localhost" is used isntead of the fqdn which I then have to change.
I also tested with the config.json file in the root renamed so it should not load. Problem is the same so this file can probably removed. Is the re-use of "localhost" in the re-generation of config.json a pointer on what might be wrong?

<!-- gh-comment-id:2798041771 --> @olaf7 commented on GitHub (Apr 11, 2025): Basically I am back at Jan 23 in this issue: https://github.com/modoboa/modoboa/issues/3377#issuecomment-2609799172 When upgrading the config.json file gets regenerated and "localhost" is used isntead of the fqdn which I then have to change. I also tested with the config.json file in the root renamed so it should not load. Problem is the same so this file can probably removed. Is the re-use of "localhost" in the re-generation of config.json a pointer on what might be wrong?
Author
Owner

@olaf7 commented on GitHub (Apr 13, 2025):

Most likely there is a link with issue #3527 . However rerunning python manage.py load_initial_data did not solve the issue, but will probably prevent 'localhost' to be inserted in files as fqdn in the future on my system.
"localhost" was the first item in the list ALLOWED_HOSTS in my settings.py

<!-- gh-comment-id:2800178786 --> @olaf7 commented on GitHub (Apr 13, 2025): Most likely there is a link with issue #3527 . However rerunning `python manage.py load_initial_data` did not solve the issue, but will probably prevent 'localhost' to be inserted in files as fqdn in the future on my system. "localhost" was the first item in the list ALLOWED_HOSTS in my settings.py
Author
Owner

@mirtouf commented on GitHub (Apr 16, 2025):

Ok, then I think there is a issue in your DB. Could you check the content of the django_site table?

In my case, I had to ensure consistency for all the listed fqdn between the table oauth2_provider_application (2 rows listing uris) and the config.json file to make sure the new-admin interface is working correctly. Otherwise, you are getting this error 400.
If I understood correctly, this table is populated by grabbing the first fqn listed in settings.py in the ALLOWED_HOSTS sections.

<!-- gh-comment-id:2809050909 --> @mirtouf commented on GitHub (Apr 16, 2025): > Ok, then I think there is a issue in your DB. Could you check the content of the django_site table? In my case, I had to ensure consistency for all the listed fqdn between the table oauth2_provider_application (2 rows listing uris) and the config.json file to make sure the new-admin interface is working correctly. Otherwise, you are getting this error 400. If I understood correctly, this table is populated by grabbing the first fqn listed in settings.py in the ALLOWED_HOSTS sections.
Author
Owner

@olaf7 commented on GitHub (Apr 16, 2025):

Thank you! Error 400 can have many causes. The URIs in the browser were right. Including those exposed by Developer Tools.
I had to replace three values of fields in the first row of the oauth table you mentioned. They did still point to localhost. After replacement the issue is resolved.
I do still think this is a bug as the net is filled with documentation and suggestions to fill ALLOWED_HOSTS with host aliases. Especially 127.0.0.1 and localhost. The code never checks on values when applying them (or rather it as only the first hostname is parsed) during installation, but does in production with the result of error 400 without a hint where to fix it.

<!-- gh-comment-id:2809831576 --> @olaf7 commented on GitHub (Apr 16, 2025): Thank you! Error 400 can have many causes. The URIs in the browser were right. Including those exposed by Developer Tools. I had to replace three values of fields in the first row of the oauth table you mentioned. They did still point to localhost. After replacement the issue is resolved. I do still think this is a bug as the net is filled with documentation and suggestions to fill ALLOWED_HOSTS with host aliases. Especially 127.0.0.1 and localhost. The code never checks on values when applying them (or rather it as only the first hostname is parsed) during installation, but does in production with the result of error 400 without a hint where to fix it.
Author
Owner

@stale[bot] commented on GitHub (Jun 26, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

<!-- gh-comment-id:3009817621 --> @stale[bot] commented on GitHub (Jun 26, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
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/modoboa-modoboa#1843
No description provided.