gethomepage / homepage

A highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations.
https://gethomepage.dev
GNU General Public License v3.0
19.11k stars 1.14k forks source link

[Bug] GameDig widget Error: Cannot find module './lib/freeze' #1795

Closed fredodiable closed 1 year ago

fredodiable commented 1 year ago

Description

GameDig widget doesn't work (don't retrieve server informations) Widget work fine running locally but not from online VPS Error: Cannot find module './lib/freeze' Am I missing something ?

Steps to reproduce

Configure GameDig widget for CSGO game server Run local (pnpm) dev version and widget work fine Run same config from online VPS (docker install) It doesn't work, see Error: Cannot find module './lib/freeze'

homepage version

v0.6.28 (63a5622, Aug 4, 2023)

Installation method

Docker

Configuration

- Test Group:
    - CSGO Server Test:
        icon: counter-strike-global-offensive.png
        widget:
            type: gamedig
            serverType: csgo
            url: udp://server.host.or.ip:27015

Container Logs

error: <gamedigProxyHandler> Error: Failed all 1 attempts
    at QueryRunner.run (/app/node_modules/.pnpm/gamedig@4.0.6/node_modules/gamedig/lib/QueryRunner.js:96:21)
    at async Gamedig.query (/app/node_modules/.pnpm/gamedig@4.0.6/node_modules/gamedig/lib/index.js:11:16)
    at async Gamedig.query (/app/node_modules/.pnpm/gamedig@4.0.6/node_modules/gamedig/lib/index.js:19:16)
    at async gamedigProxyHandler (/app/.next/server/pages/api/services/proxy.js:1996:24)
    at async Object.apiResolver (/app/node_modules/.pnpm/next@12.3.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/api-utils/node.js:366:9)
    at async NextNodeServer.runApi (/app/node_modules/.pnpm/next@12.3.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/next-server.js:481:9)
    at async Object.fn (/app/node_modules/.pnpm/next@12.3.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/next-server.js:741:37)
    at async Router.execute (/app/node_modules/.pnpm/next@12.3.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/router.js:252:36)
    at async NextNodeServer.run (/app/node_modules/.pnpm/next@12.3.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js:365:29)
    at async NextNodeServer.handleRequest (/app/node_modules/.pnpm/next@12.3.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js:303:20)
Attempt #1 - Port=27015 Retry=0:
Error: Cannot find module './lib/freeze'
Require stack:
- /app/node_modules/.pnpm/compressjs@1.0.3/node_modules/compressjs/main.js
- /app/node_modules/.pnpm/gamedig@4.0.6/node_modules/gamedig/protocols/valve.js
- /app/node_modules/.pnpm/gamedig@4.0.6/node_modules/gamedig/lib/ProtocolResolver.js
- /app/node_modules/.pnpm/gamedig@4.0.6/node_modules/gamedig/lib/QueryRunner.js
- /app/node_modules/.pnpm/gamedig@4.0.6/node_modules/gamedig/lib/index.js
- /app/.next/server/pages/api/services/proxy.js
- /app/node_modules/.pnpm/next@12.3.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/next-server.js
- /app/server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at mod._resolveFilename (/app/node_modules/.pnpm/next@12.3.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/webpack/require-hook.js:27:32)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at req (/app/node_modules/.pnpm/amdefine@1.0.1/node_modules/amdefine/amdefine.js:144:31)
    at stringRequire (/app/node_modules/.pnpm/amdefine@1.0.1/node_modules/amdefine/amdefine.js:220:28)
    at amdRequire (/app/node_modules/.pnpm/amdefine@1.0.1/node_modules/amdefine/amdefine.js:113:24)
    at /app/node_modules/.pnpm/amdefine@1.0.1/node_modules/amdefine/amdefine.js:177:24
    at Array.map (<anonymous>)
    at runFactory (/app/node_modules/.pnpm/amdefine@1.0.1/node_modules/amdefine/amdefine.js:176:25)

Browser Logs

none

Troubleshooting

Game server is public and ping from outside work Tried recreating container and restarting it

Other

Docker image is auto updated by Watchtower OS : Debian 10 (buster)

Before submitting, I have made sure to

shamoon commented 1 year ago

@fredodiable I can confirm this issue, its something related to packaging of dependencies from gamedig (see link above). If we cant resolve this unfortunately we'll have to remove the widget as it just doesnt work as-is in the docker builds.

fredodiable commented 1 year ago

@fredodiable I can confirm this issue, its something related to packaging of dependencies from gamedig (see link above). If we cant resolve this unfortunately we'll have to remove the widget as it just doesnt work as-is in the docker builds.

Adding compressjs lib has dependencies should fix/force the missing references ? Or why not a simple copy command in the docker file for "compressjs/lib" directory or main directory ?

shamoon commented 1 year ago

Tried the former but no dice (I think). Considered the latter but it feels very hack-y, haven’t tried it yet beyond confirming putting the files there does solve this. I suppose I would be ok with that if @benphelps is

Open to suggestions…

fredodiable commented 1 year ago

Issue fixed with pull request #1811 Tested with Docker Desktop Let me know if it's OK for you

github-actions[bot] commented 8 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.