fa0311 / palworld-map

Palworld map using REST API with player location information
Other
15 stars 1 forks source link

[ResponseError]: Response returned an error code #4

Closed BloodDragon2580 closed 1 month ago

BloodDragon2580 commented 5 months ago
> next start

   ▲ Next.js 14.1.4
   - Local:        http://localhost:3000

 ✓ Ready in 979ms
h [ResponseError]: Response returned an error code
    at m.request (C:\palworld-map\.next\server\app\status\route.js:1:3004)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async m.getPlayersRaw (C:\palworld-map\.next\server\app\status\route.js:1:5599)
    at async m.getPlayers (C:\palworld-map\.next\server\app\status\route.js:1:5745)
    at async g (C:\palworld-map\.next\server\app\status\route.js:1:9113)
    at async C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:42484
    at async eI.execute (C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:32486)
    at async eI.handle (C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:43737)
    at async doRender (C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\server\base-server.js:1317:42)
    at async cacheEntry.responseCache.get.routeKind (C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\server\base-server.js:1539:28) {
  response: Response {
    [Symbol(realm)]: null,
    [Symbol(state)]: {
      aborted: false,
      rangeRequested: false,
      timingAllowPassed: true,
      requestIncludesCredentials: true,
      type: 'default',
      status: 401,
      timingInfo: [Object],
      cacheState: '',
      statusText: '',
      headersList: [HeadersList],
      urlList: [Array],
      body: [Object]
    },
    [Symbol(headers)]: HeadersList {
      cookies: null,
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    }
  }
}
fa0311 commented 5 months ago

The status code seems to be 401. This means that the environment variables USERNAME or PASSWORD are not set correctly. For PASSWORD, specify "the value set in AdminPassword in PalWorldSettings.ini". USERNAME should be left as admin and not changed.

BloodDragon2580 commented 5 months ago

Hmm password is correct. Base path must be the ip or it can be the Domain name?

fa0311 commented 5 months ago

Hmm password is correct. Base path must be the ip or it can be the Domain name?

No problem either way. The Status Code is 401, which means that the connection to the server is successful. In other words, BASE_PATH is correct.


What console is doing the build? Building with Windows (PowerShell) does not seem to work well.

BloodDragon2580 commented 5 months ago
C:\palworld-map>pnpm run build

> palworld-map@0.1.0 build C:\palworld-map
> next build

   ▲ Next.js 14.1.4
   - Environments: .env

   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Linting and checking validity of types
 ✓ Collecting page data
   Generating static pages (1/5)  [=== ]
h [ResponseError]: Response returned an error code
    at m.request (C:\palworld-map\.next\server\app\status\route.js:1:3004)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async m.getPlayersRaw (C:\palworld-map\.next\server\app\status\route.js:1:5599)
    at async m.getPlayers (C:\palworld-map\.next\server\app\status\route.js:1:5745)
    at async g (C:\palworld-map\.next\server\app\status\route.js:1:9113)
    at async C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:42484
    at async eI.execute (C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:32486)
    at async eI.handle (C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:43737)
    at async exportAppRoute (C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\export\routes\app-route.js:77:26)
    at async exportPageImpl (C:\palworld-map\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\export\worker.js:175:20) {
  response: Response {
    [Symbol(realm)]: null,
    [Symbol(state)]: {
      aborted: false,
      rangeRequested: false,
      timingAllowPassed: true,
      requestIncludesCredentials: true,
      type: 'default',
      status: 401,
      timingInfo: [Object],
      cacheState: '',
      statusText: '',
      headersList: [HeadersList],
      urlList: [Array],
      body: [Object]
    },
    [Symbol(headers)]: HeadersList {
      cookies: null,
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    }
  }
 ✓ Generating static pages (5/5)
 ✓ Collecting build traces
 ✓ Finalizing page optimization

Route (app)                              Size     First Load JS
┌ ○ /                                    985 B          85.3 kB
├ ○ /_not-found                          883 B          85.2 kB
└ λ /status                              0 B                0 B
+ First Load JS shared by all            84.3 kB
  ├ chunks/672-6130f74c26b9f20b.js       29 kB
  ├ chunks/90234aad-18317e5d24c23e3a.js  53.4 kB
  └ other shared chunks (total)          1.98 kB

○  (Static)   prerendered as static content
λ  (Dynamic)  server-rendered on demand using Node.js
BloodDragon2580 commented 5 months ago

When i run it, it shows

C:\palworld-map>pnpm run start

> palworld-map@0.1.0 start C:\palworld-map
> next start

   ▲ Next.js 14.1.4
   - Local:        http://localhost:3000

 ✓ Ready in 946ms

The when i go on the Website it cones the error from first Post.

And at the Browser it comes: Application error: a client-side exception has occurred (see the browser console for more information).

fa0311 commented 5 months ago

Can I build with Node.js.command prompt?

BloodDragon2580 commented 5 months ago

I dont know the commands for node, it's my first time with it.

BloodDragon2580 commented 5 months ago

After few test i can see now the map for secounds Screenshot_2024-04-15-17-06-15-688_com opera browser-edit

Than

C:\palworldmap>pnpm run start

> palworld-map@0.1.0 start C:\palworldmap
> next start

   ▲ Next.js 14.1.4
   - Local:        http://localhost:3000

 ✓ Ready in 933ms
p [FetchError]: The request failed and the interceptors did not return an alternative response
    at m.fetchApi (C:\palworldmap\.next\server\app\status\route.js:1:2296)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async m.request (C:\palworldmap\.next\server\app\status\route.js:1:2929)
    ... 4 lines matching cause stack trace ...
    at async eI.execute (C:\palworldmap\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:32486)
    at async eI.handle (C:\palworldmap\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:43737)
    at async doRender (C:\palworldmap\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\server\base-server.js:1317:42) {
  cause: TypeError: fetch failed
      at node:internal/deps/undici/undici:12618:11
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async globalThis.fetch (C:\palworldmap\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:36091)
      at async m.fetchApi (C:\palworldmap\.next\server\app\status\route.js:1:2043)
      at async m.request (C:\palworldmap\.next\server\app\status\route.js:1:2929)
      at async m.getPlayersRaw (C:\palworldmap\.next\server\app\status\route.js:1:5598)
      at async m.getPlayers (C:\palworldmap\.next\server\app\status\route.js:1:5744)
      at async g (C:\palworldmap\.next\server\app\status\route.js:1:9112)
      at async C:\palworldmap\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:42484
      at async eI.execute (C:\palworldmap\node_modules\.pnpm\next@14.1.4_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:32486) {
    cause: ConnectTimeoutError: Connect Timeout Error
        at onConnectTimeout (node:internal/deps/undici/undici:7760:28)
        at node:internal/deps/undici/undici:7716:50
        at Immediate._onImmediate (node:internal/deps/undici/undici:7746:37)
        at process.processImmediate (node:internal/timers:478:21)
        at process.callbackTrampoline (node:internal/async_hooks:130:17) {
      code: 'UND_ERR_CONNECT_TIMEOUT'
    }
  }
}
fa0311 commented 5 months ago

I have found a solution to build by Windows. It seems that .env changes are not reflected on Windows. I am not sure if this is a bug caused by Next or Windows. To resolve this, you need to restart the terminal window. If you restart the terminal window, the .env changes will take effect.


After few test i can see now the map for secounds

Perhaps this means the server is busy or BASE_PATH is incorrect.

BloodDragon2580 commented 5 months ago

Nothing work on my server. Dont know. Thx anyway for the help.

fa0311 commented 5 months ago

Do you still get errors? If you edit the .env file, please restart your terminal window

BloodDragon2580 commented 5 months ago

Still the same error.

SILVER-uncle commented 3 months ago

Did you solve the problem here? I am having the same problem. Authentication does not go through. When I open http://localhost:[REST_API_port]/v1/api/players in my browser, I get the information successfully and the password is correct because I copied and pasted it. I tried the build in PowerShell and at the node.js prompt, both with the same result.

BloodDragon2580 commented 3 months ago

nope still the same problem

fa0311 commented 3 months ago

it works on Linux. Upgrading Next.js might solve the issue, but I can't verify it since I stopped hosting Palworld.