Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal error 500 #175

Open
jarex691 opened this issue Feb 9, 2025 · 18 comments
Open

Internal error 500 #175

jarex691 opened this issue Feb 9, 2025 · 18 comments

Comments

@jarex691
Copy link

jarex691 commented Feb 9, 2025

When building my own docker image, I followed the recommended steps listed here #59 Addtionaly I must add "npm install vitest --save-dev"
But stil I have Internal error 500 on homepage, and browser language. If I create user and log in , I have english language. Additionaly "Maps" dispalys nothing, no any map.
What I'm doing wrong ?

@Flomp
Copy link
Owner

Flomp commented Feb 10, 2025

Could you please be more specific about what you are trying to achieve? Which image would you like to build yourself wanderer-web or wanderer-db (or both)? What commands did you run? What is the error log of your containers when you start them?

@jarex691
Copy link
Author

jarex691 commented Feb 10, 2025

I wanted to build a wanderer-web container, for my purposes with customised logo and some brand strings

sudo npm ci --omit=dev
sudo npm install vitest --save-dev
sudo npm run build
cd ..
sudo docker build web/ --no-cache  -t wanderer-web:latest
sudo docker login
sudo docker tag wanderer-web:latest jarex691/wanderer-web:latest
sudo docker push jarex691/wanderer-web:latest
sudo docker compose up -d

sudo docker logs 109a83536727

Listening on 0.0.0.0:3000
TypeError: Body is unusable: Body has already been read
    at consumeBody (node:internal/deps/undici/undici:5712:15)
    at _Response.text (node:internal/deps/undici/undici:5662:18)
    at text2 (file:///app/build/server/index.js:2484:41)
    at Proxy.<anonymous> (file:///app/build/server/index.js:2498:37)
    at trails_recommend (file:///app/build/server/chunks/trail_store-PMx4DJo-.js:357:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-BnoVlnZc.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18

@Flomp
Copy link
Owner

Flomp commented Feb 11, 2025

Ok, so the error you see is caused by this line:

const response = await r.json();

I mistakenly read the body a second time in the if condition. But this is not the root cause. Something caused the response from the recommendation API endpoint to be not ok.

Can you please rewrite the section that I linked to like so and rebuild the image:

    if (!r.ok) {
        const response = await r.json();
        throw new APIError(r.status, response.message, response.detail)
    }
    const response: Trail[] = await r.json()

This should hopefully create a clearer error message.

@jarex691
Copy link
Author

jarex691 commented Feb 12, 2025

Hi,
create user error additionally.

TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
[INFO] [20:00:00]: Starting auto-upload
[ERROR] [20:00:00]: Login failed. Unable to obtain cookie.
SvelteKitError: Not found: /favicon.ico
at resolve2 (file:///app/build/server/index.js:4633:18)
at resolve (file:///app/build/server/index.js:4468:34)
at resolve (file:///app/build/server/chunks/hooks.server-Ca4hxcKs.js:44:16)
at removeLinkFromHeaders (file:///app/build/server/chunks/hooks.server-Ca4hxcKs.js:123:26)
at apply_handle (file:///app/build/server/chunks/hooks.server-Ca4hxcKs.js:26:14)
at resolve (file:///app/build/server/chunks/hooks.server-Ca4hxcKs.js:40:35)
at auth (file:///app/build/server/chunks/hooks.server-Ca4hxcKs.js:115:26)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async respond (file:///app/build/server/index.js:4466:22)
at async Array.ssr (file:///app/build/handler.js:1243:3) {
status: 404,
text: 'Not Found'
}
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
[svelte-i18n] Message "trail" has syntax error: Incorrect locale information provided
[svelte-i18n] Message "list" has syntax error: Incorrect locale information provided
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
MeiliSearchApiError: Invalid value type at .page: expected a positive integer, but found a boolean: true
at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
at Generator.next ()
at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'invalid_search_page',
type: 'invalid_request',
link: 'https://docs.meilisearch.com/errors#invalid_search_page',
httpStatus: 400
}
[INFO] [20:15:00]: Starting auto-upload
[ERROR] [20:15:00]: Login failed. Unable to obtain cookie.
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18
TypeError: Body is unusable: Body has already been read
at consumeBody (node:internal/deps/undici/undici:5712:15)
at _Response.text (node:internal/deps/undici/undici:5662:18)
at text2 (file:///app/build/server/index.js:2484:41)
at Proxy. (file:///app/build/server/index.js:2498:37)
at trails_recommend (file:///app/build/server/chunks/trail_store-BPW3B_45.js:357:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async load (file:///app/build/server/chunks/4-Zem6W3Dq.js:15:18)
at async load_data (file:///app/build/server/index.js:2405:18)
at async file:///app/build/server/index.js:3839:18

Browser console

X GET https://trasy.visitglacensis.pl/ 500 (Internal Server Error)
POST https://trasy.visitglacensis.pl/api/v1/search/trails 400 (Bad Request)
x Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
at yf (Cd-Mea6v. js: 580: 233782)
at async Q (11.DNBsZ1 a.js:1:3441)
at async Object.ua [as onmoveend] (11.DNBsZ1 a.js:1:3998)
POST https://trasy.visitglacensis.pl/api/v1/search/trails 400 (Bad Request)
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
at yf (Cd-Mea6v. js:580:233782)
at async Q (11.DNBsZ1 a.js:1:3441)
at async Object.ua [as onmoveend] (11.DNBsZ1 a.js:1:3998)
{profileBackgroundColor: '#242734', elevationGridColor: '#0002', LabelColor: '#0009', crosshairColor: '#0005', tooltipBackgroundColor: '#fff', .. }
PUT https://trasy.visitglacensis.pl/api/v1/user 400 (Bad Request)

@Flomp
Copy link
Owner

Flomp commented Feb 14, 2025

In it's current state your installation does not seem a bit salvageable, tbh. I suggest the following steps:

  1. Pull the most recent version v0.15.1 from the releases. The issue I described in my last comment is fixed there.
  2. Follow the procedure described here to setup a local development environment.
  3. Build the images without any modification to see if the process works at all
  4. If yes, make your modifications in your local development environment
  5. Rebuild the images and test them

Let me know if I can assist with any of the steps.

@jarex691
Copy link
Author

jarex691 commented Feb 16, 2025

`trap "kill 0" EXIT

export ORIGIN=http://localhost:5173
export MEILI_URL=http://127.0.0.1:7700
export MEILI_MASTER_KEY=p2gYZAWODOrwTPr4AYoahCZ9CI8y9bUd0yQLGk-E3m8
export PUBLIC_POCKETBASE_URL=http://127.0.0.1:8090
export PUBLIC_VALHALLA_URL=https://valhalla1.openstreetmap.de

cd search && ./meilisearch --master-key $MEILI_MASTER_KEY &
cd db && ./pocketbase serve &
cd web && npm run dev &

wait
`
Done, works ok.

I stopped here

wanderer@0.15.1 build

vite build

vite v5.4.14 building SSR bundle for production...
transforming (1) node_modules/@sveltejs/kit/src/runtime/server/index.js1:14:15 AM [vite-plugin-svelte] src/routes/profile/[id]/+layout.svelte:16:8 profileShareModal is updated, but is not declared with $state(...). Changing its value will not correctly trigger updates
https://svelte.dev/e/non_reactive_update
14: let { data, children } = $props();
15:
16: let profileShareModal: ProfileShareModal;
^
17:
18: let followLoading: boolean = $state(false);
transforming (206) src/lib/models/gpx/utils.ts1:14:20 AM [vite-plugin-svelte] src/routes/lists/+page.svelte:50:8 listShareModal is updated, but is not declared with $state(...). Changing its value will not correctly trigger updates
https://svelte.dev/e/non_reactive_update
48:
49: let confirmModal: ConfirmModal;
50: let listShareModal: ListShareModal;
^
51:
52: let filter: ListFilter = $state(page.data.filter);
1:14:20 AM [vite-plugin-svelte] src/lib/components/trail/trail_info_panel.svelte:71:8 gallery is updated, but is not declared with $state(...). Changing its value will not correctly trigger updates
https://svelte.dev/e/non_reactive_update
69: (trail.expand?.trail_share_via_trail?.length ?? 0) > 0;
70:
71: let gallery: PhotoGallery;
^
72:
73: let newComment: Comment = $state({
✓ 207 modules transformed.
x Build failed in 4.68s
error during build:
[vite-plugin-svelte] [plugin vite-plugin-svelte] Error while preprocessing /home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/web/src/lib/components/trail/map_with_elevation_maplibre.svelte - [postcss] Cannot apply unknown utility class: bg-background
file: /home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/web/src/lib/components/trail/map_with_elevation_maplibre.svelte
Error: [plugin vite-plugin-svelte] Error while preprocessing /home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/web/src/lib/components/trail/map_with_elevation_maplibre.svelte - [postcss] Cannot apply unknown utility class: bg-background
at onInvalidCandidate (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/tailwindcss/dist/lib.mjs:8:296)
at Q (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/tailwindcss/dist/lib.mjs:3:108916)
at file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/tailwindcss/dist/lib.mjs:8:260
at U (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/tailwindcss/dist/chunk-XOUGALJ2.mjs:1:4002)
at U (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/tailwindcss/dist/chunk-XOUGALJ2.mjs:1:4280)
at ge (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/tailwindcss/dist/lib.mjs:8:150)
at rr (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/tailwindcss/dist/lib.mjs:24:717)
at async Yr (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/tailwindcss/dist/lib.mjs:24:970)
at async tt (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/@tailwindcss/node/dist/index.mjs:10:3247)
at async p (file:///home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/node_modules/@tailwindcss/postcss/dist/index.mjs:8:3057)

@Flomp
Copy link
Owner

Flomp commented Feb 16, 2025

[vite-plugin-svelte] [plugin vite-plugin-svelte] Error while preprocessing /home/vg-trasy/htdocs/trasy.visitglacensis.pl/wanderer/web/src/lib/components/trail/map_with_elevation_maplibre.svelte - [postcss] Cannot apply unknown utility class: bg-background

Did you edit tailwind.config.js? This error complains that the CSS class bg-background is missing.

@jarex691
Copy link
Author

Did you edit tailwind.config.js? This error complains that the CSS class bg-background is missing.

No, It is untouched.

@Flomp
Copy link
Owner

Flomp commented Feb 16, 2025

Ah I know, you probably ran npm install --omit dev right? That is the correct command in case you just want to build for production but in your case you need the dev dependencies. Can you try and run npm install and rebuild?

@jarex691
Copy link
Author

jarex691 commented Feb 16, 2025

sudo npm install
sudo npm run build

without success :/ same effect

@Flomp
Copy link
Owner

Flomp commented Feb 16, 2025

Ok, so I tested the following chain of commands and it works on linux and MacOS. If it does not for you I'm afraid there is an issue with your docker or nodeJS installation:

git clone https://github.com/flomp/wanderer
cd wanderer/web
npm i
cd ..
# cp meilisearch ./search ## make sure you have a meilisearch binary in your search folder
bash run.sh
# dev server up and running
# ---------------------------
# build docker image      
cd web
export PUBLIC_VALHALLA_URL=https://valhalla1.openstreetmap.de
npm run build
cd ..
docker build web/ --no-cache  -t <your-image-name>:latest

And this is my run.sh script:

trap "kill 0" EXIT

export ORIGIN=http://localhost:5173
export MEILI_URL=http://127.0.0.1:7700
export MEILI_MASTER_KEY=<your-key-here>
export PUBLIC_POCKETBASE_URL=http://127.0.0.1:8090
export PUBLIC_VALHALLA_URL=https://valhalla1.openstreetmap.de

cd search && ./meilisearch --master-key $MEILI_MASTER_KEY &
cd db && go run pocketbase serve &
cd web && npm run dev &

wait

@jarex691
Copy link
Author

jarex691 commented Feb 16, 2025

Thanks a lot, building passed perfectly but both from https://github.com/flomp/wanderer or from source 0.15.1- I have 500 error.
Site onload has browser language, after create user and log in language changed to English

If I am logged in, in the “map” tab you can see only the location of the route, the view of the OSM map itself appears only for a fraction of a sec and disappears.
If I am logged out in "Map" I can see OSM and flag of starting point of trail.

sudo docker logs 50b4fe71adfb
Listening on 0.0.0.0:3000
APIError: TypeError: result is not iterable
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DPU7VF9D.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 500,
  detail: undefined
}
APIError: TypeError: result is not iterable
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DPU7VF9D.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 500,
  detail: undefined
}
[INFO] [20:00:00]: Starting auto-upload
[ERROR] [20:00:00]: Login failed. Unable to obtain cookie.
APIError: TypeError: result is not iterable
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DPU7VF9D.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 500,
  detail: undefined
}

@Flomp
Copy link
Owner

Flomp commented Feb 16, 2025

Ok, so I found 3 issues related to your descriptions. Let's break it down:

  1. The map becomes invisible
    Actually, it's not invisible. It is just all the way zoomed in. You can still zoom out and your trail will reappear. This is of course not ideal so I adapted the code in two places to prevent this from happening. You can pull the latest commit from main to try it out.

  2. The language is not set correctly after registering
    The language is set here:

    const language = Object.values(Language).includes(

Could you please open your browser console, type window.navigator.language and let me know the result? If the output is not "pl" (I assume you are Polish) then the language won't be correctly set after registering.

  1. The front page displays 500 error
    This one I cannot replicate. I see that it happens on your side but the error that you posted unfortunately does not point to the root cause yet. I added some clearer error messages in my latest commit. Could you please pull the latest commit and post the error that occurs when you visit the front page?

(I created an account on your wanderer instance to debug. Feel free to delete it)

@jarex691
Copy link
Author

jarex691 commented Feb 17, 2025

window.navigator.language
'pl-PL'

initial language is browser default -polish, after create user and log in- changes to english

front page displays 500 error, rest of app works ok for me

but docker logs

Listening on 0.0.0.0:3000
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DQPs5Xu3.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DQPs5Xu3.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DQPs5Xu3.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DQPs5Xu3.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DQPs5Xu3.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
{ code: 404, message: 'Not Found.', data: {} }
{ code: 404, message: 'Not Found.', data: {} }
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DQPs5Xu3.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-DQPs5Xu3.js:15:18)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}

@Flomp
Copy link
Owner

Flomp commented Feb 18, 2025

The error occurs here:

const r = await event.fetch(pb.buildUrl("/trail/recommend?" + new URLSearchParams({

For some reason, it cannot find the recommendation endpoint in PocketBase which is defined here:

e.Router.GET("/trail/recommend", func(c echo.Context) error {

I assume you have not made any changes in these files?

In the latest commit on main I fixed the default language issue after registering a new user. Furthermore, the frontpage will now load (without the recommended trails) if the call to recommend fails.

@jarex691
Copy link
Author

jarex691 commented Feb 18, 2025

Thaks a lot !
Language ok, frontpage ok (but wihout recommended trails)
Files mentioned above are intouched.

In map tab I can see only trail finish points, without trail and start point.

Listening on 0.0.0.0:3000
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-dBgYRBxu.js:17:20)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-dBgYRBxu.js:17:20)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-dBgYRBxu.js:17:20)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-dBgYRBxu.js:17:20)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
{ code: 404, message: 'Not Found.', data: {} }
APIError: Not Found.
    at trails_recommend (file:///app/build/server/chunks/trail_store-BBxkrfh9.js:357:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async load (file:///app/build/server/chunks/4-dBgYRBxu.js:17:20)
    at async load_data (file:///app/build/server/index.js:2405:18)
    at async file:///app/build/server/index.js:3839:18 {
  status: 404,
  detail: undefined
}
{ code: 404, message: 'Not Found.', data: {} }
[INFO] [23:00:00]: Starting auto-upload
[ERROR] [23:00:00]: Login failed. Unable to obtain cookie.

@Flomp
Copy link
Owner

Flomp commented Mar 15, 2025

The reason why you only see the start point is that the gpx attribute is missing in the meilisearch index:

{
    "_geo": {
        "lat": 50.19193,
        "lng": 16.670447
    },
    "author": "lznpi022udxjbc3",
    "category": "qciparzsvao2pxv",
    "completed": false,
    "created": 1739922833,
    "date": 1739836800,
    "description": "",
    "difficulty": "easy",
    "distance": 0,
    "duration": 0,
    "elevation_gain": 0,
    "elevation_loss": 0,
    "id": "11a2fa8dd8e7b49",
    "location": "",
    "name": "Roztoki -Czerniec",
    "public": true,
    "shares": []
    // "gpx": "<filename>"
}

I have no idea why this is the case as I do not have access to your pocketbase/meilisearch instances. The gpx file exists and is also correctly linked in the database. Otherwise, you would not be able to see it when clicking on the trail.

@jarex691
Copy link
Author

jarex691 commented Mar 23, 2025

In relation to using the run.sh script, what changes should be made to the docker-compose.yml file ?
v 0.16 seems OK :) build own image (without content changes) succesfully.
Last question: how to update own image in future without lost trails data ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants