Bad Gateway after Debian Trixie Migration #1349
-
Hi, After migration to Debian Trixie the package libapache2-mod-auth-openidc had a regression in v2.4.17, so I pulled the latest update from github (2.4.18) though I'm still getting a "Bad Gateway" error after SSO Login. Could anyone swiftly check over my config (the config worked previous to the debian 13 migration) and possibly one of the errors I found? [Wed Sep 03 10:34:24.834158 2025] [auth_openidc:error] [pid 264:tid 264] [client 10.10.20.1:4223] oidc_util_jwt_verify: oidc_jose_uncompress failed: [src/jose.c:1048: oidc_jose_zlib_uncompress]: inflate() failed: -3
[Wed Sep 03 10:34:24.834164 2025] [auth_openidc:warn] [pid 264:tid 264] [client 10.10.20.1:4223] oidc_state_cookies_clean_expired: state cookie could not be retrieved/decoded, deleting: mod_auth_openidc_state_9bWtheTZlgC5eq-p2f5OE599haM ServerName freshrss.localhost
DocumentRoot /opt/freshrss/p
AllowEncodedSlashes On
ServerTokens OS
TraceEnable Off
ErrorLog /var/log/apache2/error.log
# For logging the original user-agent IP instead of proxy IPs:
<IfModule mod_remoteip.c>
# Can be disabled by setting the TRUSTED_PROXY environment variable to 0:
RemoteIPHeader X-Forwarded-For
# Can be overridden by the TRUSTED_PROXY environment variable:
RemoteIPInternalProxy 10.10.20.13
</IfModule>
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_proxy
CustomLog "|/opt/freshrss/cli/sensitive-log.sh" combined_proxy
<IfDefine OIDC_ENABLED>
<IfModule !auth_openidc_module>
Error "The auth_openidc_module is not available. Install it or unset environment variable OIDC_ENABLED."
</IfModule>
# Workaround to be able to check whether an environment variable is set
# See: https://serverfault.com/questions/1022233/using-ifdefine-with-environment-variables/1022234#1022234
Define VStart "${"
Define VEnd "}"
OIDCProviderMetadataURL ${OIDC_PROVIDER_METADATA_URL}
OIDCClientID ${OIDC_CLIENT_ID}
OIDCClientSecret ${OIDC_CLIENT_SECRET}
OIDCSessionInactivityTimeout ${OIDC_SESSION_INACTIVITY_TIMEOUT}
OIDCSessionMaxDuration ${OIDC_SESSION_MAX_DURATION}
OIDCSessionType ${OIDC_SESSION_TYPE}
OIDCRedirectURI /i/oidc/
OIDCCryptoPassphrase ${OIDC_CLIENT_CRYPTOKEY}
Define "Test${OIDC_REMOTE_USERCLAIM}"
<IfDefine Test${VStart}OIDC_REMOTE_USER_CLAIM${VEnd}>
OIDCRemoteUserClaim preferredusername
</IfDefine>
<IfDefine !Test${VStart}OIDC_REMOTE_USER_CLAIM${VEnd}>
OIDCRemoteUserClaim "${OIDC_REMOTE_USERCLAIM}"
</IfDefine>
Define "Test${OIDCSCOPES}"
<IfDefine Test${VStart}OIDCSCOPES${VEnd}>
OIDCScope openid
</IfDefine>
<IfDefine !Test${VStart}OIDC_SCOPES${VEnd}>
OIDCScope "${OIDCSCOPES}"
</IfDefine>
Define "Test${OIDC_X_FORWARDEDHEADERS}"
<IfDefine !Test${VStart}OIDC_X_FORWARDED_HEADERS${VEnd}>
OIDCXForwardedHeaders ${OIDC_X_FORWARDED_HEADERS}
</IfDefine>
# Can be overridden e.g. in /var/www/FreshRSS/p/i/.htaccess
OIDCRefreshAccessTokenBeforeExpiry 30
</IfDefine>
<Directory />
AllowOverride None
Options FollowSymLinks
Require all denied
</Directory>
<Directory /opt/freshrss/p>
AllowOverride None
Include /opt/freshrss/p/.htaccess
Options FollowSymLinks
Require all granted
</Directory>
<Directory /opt/freshrss/p/api>
Include /opt/freshrss/p/api/.htaccess
</Directory>
<Directory /opt/freshrss/p/i>
ExpiresActive Off
<IfDefine OIDC_ENABLED>
AuthType openid-connect
Require valid-user
</IfDefine>
IncludeOptional /opt/freshrss/p/i/.htaccess
</Directory>
<Directory /opt/freshrss/p/themes>
Include /opt/freshrss/p/themes/.htaccess
</Directory> A bit more info is in the above issue linked on the freshrss github, but I thought I don't want to bloat this discussion here. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
@zandbelt any ideas? I'm still struggling with this |
Beta Was this translation helpful? Give feedback.
-
not sure about the uncompress error, but "bad gateway" seems like a config issue:
mod_auth_openidc is stricter in checking the x-forwarded-* headers, so local access is perhaps the issue here either always go through the reverse proxy, or add the external name ot /etc/hosts and send the X-Forwarded headers in your local request. |
Beta Was this translation helpful? Give feedback.
-
can you set "LogLevel auth_openidc:debug" to show us what is going on at the time of the bad gateway error, and paste the server error log here? |
Beta Was this translation helpful? Give feedback.
-
you will need to either:
|
Beta Was this translation helpful? Give feedback.
-
the warnings are now released in https://github.com/OpenIDC/mod_auth_openidc/releases/tag/v2.4.18.1 |
Beta Was this translation helpful? Give feedback.
you will need to either:
OIDCRefreshAccessTokenBeforeExpiry 30
as the access token cannot be refreshed anyhow (usually there's no need anyhow for using OIDCRefreshAccessTokenBeforeExpiry unless the access token gets passed down an reused downstream)