ajnart / homarr

Customizable browser's home page to interact with your homeserver's Docker containers (e.g. Sonarr/Radarr)
https://homarr.dev
MIT License
5.45k stars 252 forks source link

Invalid environment variables after upgrade to 0.15.3 #2042

Closed pathwayx99 closed 1 month ago

pathwayx99 commented 1 month ago

Environment

Docker

Version

0.15.3

Describe the problem

After upgrading to 0.15.3, I get errors that were not there in 0.15.2.

I am running on docker behind a Traefik proxy and I use SSO authentication with Authentik. Judging from the error messages, looks like something is broken in relation to OIDC?

I also confirm that reverting to 0.15.2 resolves the issue.

Logs

Exporting hostname...
Migrating database...
yarn run v1.22.19
$ ts-node ./migrate.ts
Done in 8.07s.
Starting production server...
❌ Invalid environment variables: { AUTH_OIDC_TIMEOUT: [ 'Expected string, received number' ] }
❌ Invalid environment variables: { AUTH_OIDC_TIMEOUT: [ 'Expected string, received number' ] }
Listening on port 7575 url: http://xxxxxxxxxxx:7575
/app/node_modules/@t3-oss/env-nextjs/dist/index.js:1
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _zod = require('zod');function f(e){let r=_nullishCoalesce(_nullishCoalesce(e.runtimeEnvStrict, () => (e.runtimeEnv)), () => (process.env));if(_nullishCoalesce(e.emptyStringAsUndefined, () => (!1)))for(let[t,n]of Object.entries(r))n===""&&delete r[t];if(e.skipValidation)return r;let i=typeof e.client=="object"?e.client:{},o=typeof e.server=="object"?e.server:{},s=typeof e.shared=="object"?e.shared:{},d=_zod.z.object(i),T=_zod.z.object(o),l=_zod.z.object(s),v=_nullishCoalesce(e.isServer, () => (typeof window>"u")),p=d.merge(l),y=T.merge(l).merge(d),c=v?y.safeParse(r):p.safeParse(r),m=_nullishCoalesce(e.onValidationError, () => ((t=>{throw console.error("\u274C Invalid environment variables:",t.flatten().fieldErrors),new Error("Invalid environment variables")}))),u=_nullishCoalesce(e.onInvalidAccess, () => ((t=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")})));return c.success===!1?m(c.error):new Proxy(c.data,{get(t,n){if(!(typeof n!="string"||n==="__esModule"||n==="$$typeof"))return!v&&e.clientPrefix&&!n.startsWith(e.clientPrefix)&&l.shape[n]===void 0?u(n):t[n]}})}var x="NEXT_PUBLIC_";function P(e){let r=typeof e.client=="object"?e.client:{},i=typeof e.server=="object"?e.server:{},o=e.shared,s=e.runtimeEnv?e.runtimeEnv:{...process.env,...e.experimental__runtimeEnv};return f({...e,shared:o,client:r,server:i,clientPrefix:x,runtimeEnv:s})}exports.createEnv = P;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^
Error: Invalid environment variables
    at /app/node_modules/@t3-oss/env-nextjs/dist/index.js:1:903
    at f (/app/node_modules/@t3-oss/env-nextjs/dist/index.js:1:1121)
    at P (/app/node_modules/@t3-oss/env-nextjs/dist/index.js:1:1520)
    at 68028 (/app/.next/server/chunks/5535.js:5321:13)
    at __webpack_require__ (/app/.next/server/webpack-runtime.js:25:43)
    at /app/.next/server/chunks/5535.js:7519:62
    at __webpack_require__.a (/app/.next/server/webpack-runtime.js:89:13)
    at 77829 (/app/.next/server/chunks/5535.js:7509:21)
    at __webpack_require__ (/app/.next/server/webpack-runtime.js:25:43)
    at /app/.next/server/chunks/5535.js:5174:68
Node.js v20.2.0
Error: connect ECONNREFUSED xxx.xxx.xxx.xxx:40245
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1571:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: 'xxx.xxx.xxx.xxx',
  port: 40245
}

Context

My environment variables in my docker-compose file are as follows:

      - BASE_URL=xxx.yyy.com
      - AUTH_PROVIDER=oidc
      - AUTH_OIDC_URI=https://auth.yyy.com/application/o/homarr
      - AUTH_OIDC_CLIENT_SECRET=theclientsecret
      - AUTH_OIDC_CLIENT_ID=theclientid
      - AUTH_OIDC_CLIENT_NAME=Authentik
      - NEXTAUTH_URL=https://xxx.yyy.com
      - AUTH_OIDC_ADMIN_GROUP=aaa
      - AUTH_OIDC_OWNER_GROUP=bbb

No response

Please tick the boxes

github-actions[bot] commented 1 month ago

Hi 👋. Thank you for submitting your first issue to Homarr. Please ensure that you've provided all nessesary information. You can use the three dots > Edit button to update your post with additional images and information. Depending on the current volume of requests, the team should get in conact with you shortly.

manuel-rw commented 1 month ago

Confirmed bug 👍

manuel-rw commented 1 month ago

Already fixed in #2041

manuel-rw commented 1 month ago

We deleted our previous release and overwrote tag 0.15.3. https://github.com/ajnart/homarr/pkgs/container/homarr/213801209?tag=0.15.3

This means you'll have to repull the image

Enjoy!

pathwayx99 commented 1 month ago

Re-pulled and redeployed.

Can confirm, fixed.

That's gotta be some sort of speed record on bug resolution 😁. Awesome job!