SkepticMystic
SkepticMystic
Explore posts from servers
IImmich
Created by SkepticMystic on 1/23/2025 in #help-desk-support
How to POST /assets
Hi there, I'm trying to upload an asset using POST /assets. I can't figure out how to send the file data, however. Currently, my code looks like this:
const upload = (body: {
file: File;
}) => {
const form = new FormData();

const uuid = crypto.randomUUID();
const now = new Date().toISOString();

form.set("assetData", body.file);
form.set("deviceId", uuid);
form.set("deviceAssetId", uuid);
form.set("fileCreatedAt", now);
form.set("fileModifiedAt", now);

return request("/assets", {
body: form,
method: "POST",
headers: {
Accept: "application/json",
"Content-Type":
"multipart/form-data; boundary=---WebKitFormBoundary7MA4YWxkTrZu0gW",
},
});
}
const upload = (body: {
file: File;
}) => {
const form = new FormData();

const uuid = crypto.randomUUID();
const now = new Date().toISOString();

form.set("assetData", body.file);
form.set("deviceId", uuid);
form.set("deviceAssetId", uuid);
form.set("fileCreatedAt", now);
form.set("fileModifiedAt", now);

return request("/assets", {
body: form,
method: "POST",
headers: {
Accept: "application/json",
"Content-Type":
"multipart/form-data; boundary=---WebKitFormBoundary7MA4YWxkTrZu0gW",
},
});
}
If I exclude the Content-Type header, I get a validation error saying the various fields are missing. If I add Content-Type: multipart/form-data, I get a Multipart: Boundary not found error. If I add Content-Type: multipart/form-data; boundary=---WebKitFormBoundary7MA4YWxkTrZu0gW, I get a Multipart: Unexpected end of form error. I found that boundary value in a few places on the web, but it doesn't seem to work. I'm not sure how to proceed. How do I upload an asset?
8 replies
IImmich
Created by SkepticMystic on 12/31/2024 in #help-desk-support
could not select device driver "nvidia" with capabilities: [[gpu]]
Hi there, I'm trying to setup remote ml acceleration by following these two guides: - https://immich.app/docs/features/ml-hardware-acceleration - https://immich.app/docs/guides/remote-machine-learning I've setup the docker-compose.yml on the remote machine as follows:
name: immich_remote_ml

services:
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-cuda
extends:
file: hwaccel.ml.yml
service: cuda
volumes:
- model-cache:/cache
restart: always
ports:
- 3003:3003

volumes:
model-cache:
name: immich_remote_ml

services:
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-cuda
extends:
file: hwaccel.ml.yml
service: cuda
volumes:
- model-cache:/cache
restart: always
ports:
- 3003:3003

volumes:
model-cache:
But on docker compose up -d, I get could not select device driver "nvidia" with capabilities: [[gpu]]. I've also installed nvidia-container-toolkit
4 replies
IImmich
Created by SkepticMystic on 12/30/2024 in #help-desk-support
SMTP Settings: Invalid user token (Immich Server Error)
Hi there, I'm trying to setup SMTP on a new immich instance. I've entered the gmail details just as before on a different instance (running on the same machine). But I get the error above, in the title. It may be a port issue, given that the two instance are both running on one machine. But I believe I've gone through and change the ports around properly. The request to /api/notifications/test-email is being sent to the correct port (2284, in this case)
9 replies
IImmich
Created by SkepticMystic on 11/28/2024 in #help-desk-support
Prometheus scraping error: Error scraping target: Get "http://localhost:8081/metrics": dial tcp [::1
Hi there I'm trying to setup Prometheus to scrape immich. Immich is running in a separate compose file to Prometheus. I tried adding the Immich network to the Prometheus compose file as follows:
---
services:
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./config:/etc/prometheus
- prometheus-data:/prometheus
ports:
- "9090:9090"
networks:
- prometheus
- immich
restart: unless-stopped

volumes:
prometheus-data:

networks:
prometheus:
driver: bridge
immich:
external: true
name: immich_default
---
services:
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./config:/etc/prometheus
- prometheus-data:/prometheus
ports:
- "9090:9090"
networks:
- prometheus
- immich
restart: unless-stopped

volumes:
prometheus-data:

networks:
prometheus:
driver: bridge
immich:
external: true
name: immich_default
But still get the error: Error scraping target: Get "http://localhost:8081/metrics": dial tcp [::1]:8081: connect: connection refused on Prometheus
6 replies
DDeno
Created by SkepticMystic on 9/5/2024 in #help
How to only load worker once
I have a file that initialises a worker, and exports a function that posts a message to that worker. But if I import that function into multiple other files, the worker gets loaded each time. How can I prevent this to ensure only one instance of the worker is loaded, regardless of how many files I use the function in?
2 replies
IImmich
Created by SkepticMystic on 8/26/2024 in #help-desk-support
How to use whatsapp-media-date-to-exif tool to parse image date
Hi there I see this discussion about Whatsapp images having incorrect/missing date info: https://github.com/immich-app/immich/discussions/9116. In it, someone posted a script to automatically parse the date from the file name: https://github.com/icecore2/whatsapp-media-date-to-exif My question is, on which version of the image should I run this script? Should I run it on the original images on my phone - how would I do that? Should I run it on the ${UPLOAD_LOCATION}/library folder recursively?
17 replies
TTwenty
Created by SkepticMystic on 5/20/2024 in #❓︱help
How to bulk delete _many_ records
In testing the /batch endpoint, we've accidentally uploaded far too many copies of the same record (cause there aren't unique constraints yet). Is there an easy way to clear the table? I see there isn't a bulk-delete endpoint, and the UI only lets you select 60 items at a time
5 replies
TTwenty
Created by SkepticMystic on 5/15/2024 in #❓︱help
Can I make a custom field on a custom object unique?
Is it possible to enforce uniqueness on a custom field that I've added to an entirely custom object?
3 replies
TTwenty
Created by SkepticMystic on 4/8/2024 in #❓︱help
How customisable are tasks?
It seems like tasks aren't a regular object, can we add/remove fields?
6 replies
TTwenty
Created by SkepticMystic on 2/20/2024 in #❓︱help
API token not recognised by docs generator
Hi there 👋 I've just gotten started with Twenty. We used the Deploy to Render route, and it went smoothly. However, now when trying to learn more about the API, we can't access the docs. I understand a token is needed to generate the docs specific to our org. So I go to Settings > Developers > Create API key. This works, I get a new token. But when pasting that into https://docs.twenty.com/rest-api/core#/, along with our url, I get the error saying a token is required.
3 replies
DDeno
Created by SkepticMystic on 2/1/2023 in #help
docker compose up of Oak server throws: SyntaxError: Duplicate export of 'type'
I am just learning how to use Docker, and am trying to put up a container of an Oak server. When running docker compose up, it throws the error mentioned above. This doesn't happen locally, or on Deno Deploy. I'm not really sure where to start? Can I somehow ignore this error, or is it actually a problem? My docker-compose.yml is:
version: "3"

services:
web:
build: .
container_name: server
image: deno-image
ports:
- "8000:8000"
version: "3"

services:
web:
build: .
container_name: server
image: deno-image
ports:
- "8000:8000"
And Dockerfile:
FROM denoland/deno:1.10.3

EXPOSE 8000

WORKDIR /app

USER deno

ADD . /app

RUN deno cache --no-check src/index.ts

CMD ["run", "--allow-net", "--allow-read", "--allow-env", "--no-check", "src/index.ts"]
FROM denoland/deno:1.10.3

EXPOSE 8000

WORKDIR /app

USER deno

ADD . /app

RUN deno cache --no-check src/index.ts

CMD ["run", "--allow-net", "--allow-read", "--allow-env", "--no-check", "src/index.ts"]
The full error is:
server | error: Uncaught SyntaxError: Duplicate export of 'type'
server | export { type NativeRequest } from "./http_server_native_request.ts";
server | ~~~~
server | at <anonymous> (https://deno.land/x/[email protected]/mod.ts:93:10)
server | error: Uncaught SyntaxError: Duplicate export of 'type'
server | export { type NativeRequest } from "./http_server_native_request.ts";
server | ~~~~
server | at <anonymous> (https://deno.land/x/[email protected]/mod.ts:93:10)
Any help would be greatly appreciated, thank you
2 replies
DDeno
Created by SkepticMystic on 11/29/2022 in #help
Is there an event that triggers when an Oak Deploy instance is closing?
I cannot find anything in the Deploy docs, specifically. But I see that the Oak app runs a callback when the server closes. Something like this should work, I think:
app.listen({ port: 8080 }).then(() => {
console.log('Shutting down...');
db.collection('test').insertOne({ createdAt: new Date() })
});
app.listen({ port: 8080 }).then(() => {
console.log('Shutting down...');
db.collection('test').insertOne({ createdAt: new Date() })
});
But the console log doesn't run. Maybe the way Deploy closes instances doesn't allow for this? Any advice would be really helpful
1 replies
DDeno
Created by SkepticMystic on 10/17/2022 in #help
Silence error logs on Oak server
I'm trying to silence specific errors on an Oak server on Deploy. A Github issue said to add an 'error' event listener to the app. I did the following, but the error is still logged. Am I missing something?
app.addEventListener('error', (e) => {
const lowerMsg = e.error?.message?.toLowerCase();
if (lowerMsg?.includes('early eof')) { return }
console.error(e.error);
})
app.addEventListener('error', (e) => {
const lowerMsg = e.error?.message?.toLowerCase();
if (lowerMsg?.includes('early eof')) { return }
console.error(e.error);
})
5 replies