Closed andrejohansson closed 1 year ago
Immich doesn't have any SMTP related code and doesn't do any sort of email sending in general. The error logs you post are a bit strange and don't really have much information. Are there any other logs? Are you seeing any unusual behaviour when using Immich?
I digged some more, it comes from my scheduled job that tries to import new assets (which have been running since the 1.79 update). I updated the title of this since the smtp part seems to be my servers default config. But it seems that some library id must be provided also now?
Script command
docker exec -i immich_server /bin/sh -c "immich upload --key <my-key> --server http://immich_proxy:8080/api /mnt/media/familjen --recursive --import -y"
Response error:
Oct 2 16:31:11 singularity sSMTP[2258465]: response: {
Oct 2 16:31:11 singularity sSMTP[2258465]: message: [
Oct 2 16:31:11 singularity sSMTP[2258465]: 'libraryId must be a UUID',
Oct 2 16:31:11 singularity sSMTP[2258465]: 'libraryId should not be empty',
Oct 2 16:31:11 singularity sSMTP[2258465]: 'libraryId must be a string'
Oct 2 16:31:11 singularity sSMTP[2258465]: ],
Oct 2 16:31:11 singularity sSMTP[2258465]: error: 'Bad Request',
Oct 2 16:31:11 singularity sSMTP[2258465]: statusCode: 400
Oct 2 16:31:11 singularity sSMTP[2258465]: }
A full log entry
Oct 2 16:31:11 singularity sSMTP[2258465]: Error asset: {
Oct 2 16:31:11 singularity sSMTP[2258465]: file: '/mnt/media/familjen/2018/Aug/IMG_4336.MOV',
Oct 2 16:31:11 singularity sSMTP[2258465]: reason: Error: Request failed with status code 400
Oct 2 16:31:11 singularity sSMTP[2258465]: at createError (/usr/src/app/node_modules/immich/node_modules/axios/lib/core/createError.js:16:15)
Oct 2 16:31:11 singularity sSMTP[2258465]: at settle (/usr/src/app/node_modules/immich/node_modules/axios/lib/core/settle.js:17:12)
Oct 2 16:31:11 singularity sSMTP[2258465]: at IncomingMessage.handleStreamEnd (/usr/src/app/node_modules/immich/node_modules/axios/lib/adapters/http.js:322:11)
Oct 2 16:31:11 singularity sSMTP[2258465]: at IncomingMessage.emit (node:events:526:35)
Oct 2 16:31:11 singularity sSMTP[2258465]: at endReadableNT (node:internal/streams/readable:1359:12)
Oct 2 16:31:11 singularity sSMTP[2258465]: at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
Oct 2 16:31:11 singularity sSMTP[2258465]: config: {
Oct 2 16:31:11 singularity sSMTP[2258465]: transitional: [Object],
Oct 2 16:31:11 singularity sSMTP[2258465]: adapter: [Function: httpAdapter],
Oct 2 16:31:11 singularity sSMTP[2258465]: transformRequest: [Array],
Oct 2 16:31:11 singularity sSMTP[2258465]: transformResponse: [Array],
Oct 2 16:31:11 singularity sSMTP[2258465]: timeout: 0,
Oct 2 16:31:11 singularity sSMTP[2258465]: xsrfCookieName: 'XSRF-TOKEN',
Oct 2 16:31:11 singularity sSMTP[2258465]: xsrfHeaderName: 'X-XSRF-TOKEN',
Oct 2 16:31:11 singularity sSMTP[2258465]: maxContentLength: Infinity,
Oct 2 16:31:11 singularity sSMTP[2258465]: maxBodyLength: Infinity,
Oct 2 16:31:11 singularity sSMTP[2258465]: validateStatus: [Function: validateStatus],
Oct 2 16:31:11 singularity sSMTP[2258465]: headers: [Object],
Oct 2 16:31:11 singularity sSMTP[2258465]: method: 'post',
Oct 2 16:31:11 singularity sSMTP[2258465]: maxRedirects: 0,
Oct 2 16:31:11 singularity sSMTP[2258465]: url: 'http://immich_proxy:8080/api/asset/import',
Oct 2 16:31:11 singularity sSMTP[2258465]: data: '{"deviceAssetId":"IMG_4336.MOV-3400878","deviceId":"CLI","fileCreatedAt":"2018-04-22T09:34:32.000Z","fileModifiedAt":"2018-04-22T09:34:32.000Z","isFavorite":"false","fileExtension":".MOV","duration":"0:00:00.000000","isReadOnly":"true","assetPath":"/mnt/media/familjen/2018/Aug/IMG_4336.MOV"}'
Oct 2 16:31:11 singularity sSMTP[2258465]: },
Oct 2 16:31:11 singularity sSMTP[2258465]: request: ClientRequest {
Oct 2 16:31:11 singularity sSMTP[2258465]: _events: [Object: null prototype],
Oct 2 16:31:11 singularity sSMTP[2258465]: _eventsCount: 3,
Oct 2 16:31:11 singularity sSMTP[2258465]: _maxListeners: undefined,
Oct 2 16:31:11 singularity sSMTP[2258465]: outputData: [],
Oct 2 16:31:11 singularity sSMTP[2258465]: outputSize: 0,
Oct 2 16:31:11 singularity sSMTP[2258465]: writable: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: destroyed: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: _last: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: chunkedEncoding: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: shouldKeepAlive: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: maxRequestsOnConnectionReached: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: _defaultKeepAlive: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: useChunkedEncodingByDefault: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: sendDate: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: _removedConnection: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: _removedContLen: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: _removedTE: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: strictContentLength: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: _contentLength: 292,
Oct 2 16:31:11 singularity sSMTP[2258465]: _hasBody: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: _trailer: '',
Oct 2 16:31:11 singularity sSMTP[2258465]: finished: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: _headerSent: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: _closed: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: socket: [Socket],
Oct 2 16:31:11 singularity sSMTP[2258465]: _header: 'POST /api/asset/import HTTP/1.1\r\n' +
Oct 2 16:31:11 singularity sSMTP[2258465]: 'Accept: application/json, text/plain, */*\r\n' +
Oct 2 16:31:11 singularity sSMTP[2258465]: 'Content-Type: application/json\r\n' +
Oct 2 16:31:11 singularity sSMTP[2258465]: 'x-api-key: RETRACTED' +
Oct 2 16:31:11 singularity sSMTP[2258465]: 'User-Agent: axios/0.26.1\r\n' +
Oct 2 16:31:11 singularity sSMTP[2258465]: 'Content-Length: 292\r\n' +
Oct 2 16:31:11 singularity sSMTP[2258465]: 'Host: immich_proxy:8080\r\n' +
Oct 2 16:31:11 singularity sSMTP[2258465]: 'Connection: close\r\n' +
Oct 2 16:31:11 singularity sSMTP[2258465]: '\r\n',
Oct 2 16:31:11 singularity sSMTP[2258465]: _keepAliveTimeout: 0,
Oct 2 16:31:11 singularity sSMTP[2258465]: _onPendingData: [Function: nop],
Oct 2 16:31:11 singularity sSMTP[2258465]: agent: [Agent],
Oct 2 16:31:11 singularity sSMTP[2258465]: socketPath: undefined,
Oct 2 16:31:11 singularity sSMTP[2258465]: method: 'POST',
Oct 2 16:31:11 singularity sSMTP[2258465]: maxHeaderSize: undefined,
Oct 2 16:31:11 singularity sSMTP[2258465]: insecureHTTPParser: undefined,
Oct 2 16:31:11 singularity sSMTP[2258465]: joinDuplicateHeaders: undefined,
Oct 2 16:31:11 singularity sSMTP[2258465]: path: '/api/asset/import',
Oct 2 16:31:11 singularity sSMTP[2258465]: _ended: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: res: [IncomingMessage],
Oct 2 16:31:11 singularity sSMTP[2258465]: aborted: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: timeoutCb: null,
Oct 2 16:31:11 singularity sSMTP[2258465]: upgradeOrConnect: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: parser: null,
Oct 2 16:31:11 singularity sSMTP[2258465]: maxHeadersCount: null,
Oct 2 16:31:11 singularity sSMTP[2258465]: reusedSocket: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: host: 'immich_proxy',
Oct 2 16:31:11 singularity sSMTP[2258465]: protocol: 'http:',
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(kCapture)]: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(kBytesWritten)]: 0,
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(kNeedDrain)]: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(corked)]: 0,
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(kOutHeaders)]: [Object: null prototype],
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(errored)]: null,
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(kHighWaterMark)]: 16384,
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(kRejectNonStandardBodyWrites)]: false,
Oct 2 16:31:11 singularity sSMTP[2258465]: [Symbol(kUniqueHeaders)]: null
Oct 2 16:31:11 singularity sSMTP[2258465]: },
Oct 2 16:31:11 singularity sSMTP[2258465]: response: {
Oct 2 16:31:11 singularity sSMTP[2258465]: status: 400,
Oct 2 16:31:11 singularity sSMTP[2258465]: statusText: 'Bad Request',
Oct 2 16:31:11 singularity sSMTP[2258465]: headers: [Object],
Oct 2 16:31:11 singularity sSMTP[2258465]: config: [Object],
Oct 2 16:31:11 singularity sSMTP[2258465]: request: [ClientRequest],
Oct 2 16:31:11 singularity sSMTP[2258465]: data: [Object]
Oct 2 16:31:11 singularity sSMTP[2258465]: },
Oct 2 16:31:11 singularity sSMTP[2258465]: isAxiosError: true,
Oct 2 16:31:11 singularity sSMTP[2258465]: toJSON: [Function: toJSON]
Oct 2 16:31:11 singularity sSMTP[2258465]: },
Oct 2 16:31:11 singularity sSMTP[2258465]: response: {
Oct 2 16:31:11 singularity sSMTP[2258465]: message: [
Oct 2 16:31:11 singularity sSMTP[2258465]: 'libraryId must be a UUID',
Oct 2 16:31:11 singularity sSMTP[2258465]: 'libraryId should not be empty',
Oct 2 16:31:11 singularity sSMTP[2258465]: 'libraryId must be a string'
Oct 2 16:31:11 singularity sSMTP[2258465]: ],
Oct 2 16:31:11 singularity sSMTP[2258465]: error: 'Bad Request',
Oct 2 16:31:11 singularity sSMTP[2258465]: statusCode: 400
Oct 2 16:31:11 singularity sSMTP[2258465]: }
Oct 2 16:31:11 singularity sSMTP[2258465]: }
We will be deprecating read-only
feature to support the newly added library
feature. Please consider migrating to the new library
approach
This is also fixed in 1.80. Let us know if you still run into the issue after upgrading to the latest release!
The bug
My server emits smtp authentication errors and floods my logs in
/var/log/mail.log
Having outgoing emails with errors and potential insecure stack traces is a risk that I would like to opt into, not happen without my knowledge. Have I missed some setting perhaps?
The OS that Immich Server is running on
Ubuntu 22.04
Version of Immich Server
v1.80.0
Version of Immich Mobile App
v1.79.0 build.103
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Additional information