pigallery2
pigallery2 copied to clipboard
Setting container to listen on port other than 80 causes Healthcheck to fail, spams syslog (via systemd)
Describe the bug
docker ps returns an unhealthy container. syslog is flooded with systemd updates for run-docker-runtime:
systemd[23331]: run-docker-runtime\x2drunc-moby-037a7f970147c20a1ed9fecd8cbe1d035f29eab28fdbdf368c863345076a087d-runc.by6yAr.mount: Succeeded.
Just a guess but, I've set the container to listen on port 8899 and healthcheck is listening for a heartbeat on localhost:80 ?
$ docker inspect pigallery2 | grep Healthcheck -A 10
"Healthcheck": {
"Test": [
"CMD-SHELL",
"wget --quiet --tries=1 --no-check-certificate --spider http://localhost:80/heartbeat || exit 1"
],
"Interval": 40000000000,
"Timeout": 30000000000,
"StartPeriod": 60000000000,
"Retries": 3
}
but maybe I'm wrong because those intervals sure are long.
Server logs (optional) Included below
Click to expand:
$ docker logs pigallery2
[Typeconfig] Loading config. Path: /app/data/config/config.json
[Typeconfig] Loading defaults from file: undefined
[Typeconfig] Loading defaults, def prefix: default
[Typeconfig] no default cli found among these: {
"expose": {
"gc": true
},
"config": {
"path": "/app/data/config/config.json"
},
"restart": "unless-stopped"
}
[Typeconfig] from env: {
"Server": {
"Database": {
"dbFolder": "/app/data/db"
},
"Media": {
"folder": "/app/data/images",
"tempFolder": "/app/data/tmp"
}
}
}
[Typeconfig] Processing cli and ENV inputs: {
"expose": {
"gc": true
},
"config": {
"path": "/app/data/config/config.json"
},
"restart": "unless-stopped"
}
[Typeconfig] Processing cli and ENV inputs: {
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HOSTNAME": "360cfe4c168b",
"NODE_ENV": "debug",
"NODE_VERSION": "14.19.0",
"YARN_VERSION": "1.22.17",
"PI_DOCKER": true,
"HOME": "/root"
}
NODE_ENV environmental variable is set to debug, forcing all logs to print
4/13/2022, 10:53:52 PM[INFO_][server] Running in DEBUG mode, set env variable NODE_ENV=production to disable
4/13/2022, 10:53:52 PM[INFO_][server] running diagnostics...
4/13/2022, 10:53:52 PM[VERBS][server] using config from /app/data/config/config.json:
4/13/2022, 10:53:52 PM[VERBS][server] {
"Server": {
"sessionSecret": [
"56ffd48957be057a725fde722cc2dd51bf021b1cccb96f2158082a725c72e7f7c72970f3ed6e0a7c3be9b1cd5c3692463d12306be4d1cb544163611ea1c91475a95fc8eff18a90b8e9227e9cb5b5e184331d3f4513ab10654494e942d66a4282562cdacaa877da236a687a55f0caf232419bdc8ab681f2d997b6b8359b27c385e496bac33ffdc2f506854028bc54c3eca5588ccd2b31e76006a218a2f628cf7b860be6cb6069a576ae627edad33b0cbc196cc9d3fc886a193cc74738e65a75452f44c2997d6cdc79362fbe89873988e12db0964d9b97fa9d6a1e266f0137021b48f27ff56adddfd47f6e61fbd9a5cb2607db8956713a13c0e44398dfcc0fb023",
"9410939176abdad98c42277e544d7245529ba7c605ec24c799d7fddc032bc1cdd05c9095069199d10c934c3533498a168518814f1808df7bc2d556d3ca0c0e76c9085403b9242d37e0fe7033e80b9bb23fb33e5c9166c3cd6e20a6674586db39c242359c19865e42042a3a57cfdc5ff7ecc504db4f8d46388daa15218b519ff245515103f1adfba4b387bd5cfc25058cde02b4d4df8e2b12eebf6cad7feec999d693ef9e95995880a7f9cd566a16c5d20bf9813eeb2c5ce09fd6e598c968ef8b69bd47e7fe3d22b76537d2acd06757e2a3981b31ed817d31044a2ffc556c57f00becb45526a8e93930c790d968849c039454158640995dd48f9db72db59f9c7a",
"6a9d2f17c059860c03648d0417689d8b5de08387681fb5534fa6c6bab3e4ac84b57a78bcbdbabaa2e880d9af4bd4fb98db1d5a8a584f266e593a1d2e263f29f046738da1097cef9bc7ffa0d6250536043bc6af475355c3ff9cac9eae9fd27c80b439e09476852930e885b801e24519a104f5d20fb50021603a5e2b08f4ff16b1ef380fb22c7d0190721a83baeb3e63c35b5bdfdc3eadb0bc72587e99687e1911dae3ded16c384e319a1b353a79185059027dccd429a93e4c11589825427fbf4609318c1c718b61b0097e4df5db68f1d0dc2d2229d538ffebeec54cda2b04538cfa4265b990025cf9f119ffb82cdcced156842102097cdce642304177c51b4cc3"
],
"port": 8899,
"host": "0.0.0.0",
"Media": {
"//[folder]": "Images are loaded from this folder (read permission required)",
"folder": "/app/data/images",
"//[tempFolder]": "Thumbnails, converted photos, videos will be stored here (write permission required)",
"tempFolder": "/app/data/tmp",
"Video": {
"transcoding": {
"bitRate": 5242880,
"resolution": 720,
"fps": 25,
"codec": "libx264",
"format": "mp4",
"//[crf]": "Constant Rate Factor. The range of the CRF scale is 0–51, where 0 is lossless, 23 is the default, and 51 is worst quality possible.",
"crf": 23,
"//[preset]": "A preset is a collection of options that will provide a certain encoding speed to compression ratio",
"preset": "medium",
"//[customOptions]": "It will be sent to ffmpeg as it is, as custom options.",
"customOptions": []
}
},
"Photo": {
"Converting": {
"//[onTheFly]": "Converts photos on the fly, when they are requested.",
"onTheFly": true,
"resolution": 1080
}
},
"Thumbnail": {
"//[qualityPriority]": "if true, photos will have better quality.",
"qualityPriority": true,
"personFaceMargin": 0.6
}
},
"Preview": {
"SearchQuery": {
"type": 100,
"text": ""
},
"Sorting": [
6,
4
]
},
"Threading": {
"//[enabled]": "App can run on multiple thread",
"enabled": true,
"//[thumbnailThreads]": "Number of threads that are used to generate thumbnails. If 0, number of 'CPU cores -1' threads will be used.",
"thumbnailThreads": 0
},
"Database": {
"type": "sqlite",
"dbFolder": "/app/data/db",
"sqlite": {
"DBFileName": "sqlite.db"
},
"mysql": {
"host": "localhost",
"port": 3306,
"database": "pigallery2",
"username": "",
"password": ""
},
"//[enforcedUsers]": "Creates these users in the DB if they do not exist. If a user with this name exist, it wont be overwritten, even if the role is different.",
"enforcedUsers": []
},
"Sharing": {
"updateTimeout": 300000
},
"//[sessionTimeout]": "unit: ms",
"sessionTimeout": 604800000,
"Indexing": {
"cachedFolderTimeout": 3600000,
"reIndexingSensitivity": "low",
"//[excludeFolderList]": "If an entry starts with '/' it is treated as an absolute path. If it doesn't start with '/' but contains a '/', the path is relative to the image directory. If it doesn't contain a '/', any folder with this name will be excluded.",
"excludeFolderList": [
".Trash-1000",
".dtrash",
"$RECYCLE.BIN"
],
"//[excludeFileList]": "Any folder that contains a file with this name will be excluded from indexing.",
"excludeFileList": []
},
"//[photoMetadataSize]": "only this many bites will be loaded when scanning photo for metadata",
"photoMetadataSize": 524288,
"Duplicates": {
"listingLimit": 1000
},
"Log": {
"level": "info",
"sqlLevel": "error",
"logServerTiming": false
},
"Jobs": {
"//[maxSavedProgress]": "Job history size",
"maxSavedProgress": 10,
"scheduled": [
{
"name": "Indexing",
"jobName": "Indexing",
"config": {
"indexChangesOnly": true
},
"allowParallelRun": false,
"trigger": {
"type": "never"
}
},
{
"name": "Preview Filling",
"jobName": "Preview Filling",
"config": {},
"allowParallelRun": false,
"trigger": {
"type": "never"
}
},
{
"name": "Thumbnail Generation",
"jobName": "Thumbnail Generation",
"config": {
"sizes": [
240
],
"indexedOnly": true
},
"allowParallelRun": false,
"trigger": {
"type": "after",
"afterScheduleName": "Preview Filling"
}
},
{
"name": "Photo Converting",
"jobName": "Photo Converting",
"config": {
"indexedOnly": true
},
"allowParallelRun": false,
"trigger": {
"type": "after",
"afterScheduleName": "Thumbnail Generation"
}
},
{
"name": "Video Converting",
"jobName": "Video Converting",
"config": {
"indexedOnly": true
},
"allowParallelRun": false,
"trigger": {
"type": "after",
"afterScheduleName": "Photo Converting"
}
},
{
"name": "Temp Folder Cleaning",
"jobName": "Temp Folder Cleaning",
"config": {
"indexedOnly": true
},
"allowParallelRun": false,
"trigger": {
"type": "after",
"afterScheduleName": "Video Converting"
}
}
]
}
},
"Client": {
"applicationTitle": *REDACTED*,
"publicUrl": *REDACTED* ",
"urlBase": "/gallery",
"Search": {
"enabled": true,
"searchCacheTimeout": 3600000,
"AutoComplete": {
"enabled": true,
"targetItemsPerCategory": 5,
"maxItems": 30,
"cacheTimeout": 3600000
},
"maxMediaResult": 10000,
"//[listDirectories]": "Search returns also with directories, not just media",
"listDirectories": false,
"//[listMetafiles]": "Search also returns with metafiles from directories that contain a media file of the matched search result",
"listMetafiles": true,
"maxDirectoryResult": 200
},
"Sharing": {
"enabled": true,
"passwordProtected": true
},
"Album": {
"enabled": true
},
"Map": {
"enabled": false,
"//[maxPreviewMarkers]": "Maximum number of markers to be shown on the map preview on the gallery page.",
"maxPreviewMarkers": 50,
"useImageMarkers": false,
"mapProvider": "OpenStreetMap",
"mapboxAccessToken": "",
"customLayers": [
{
"name": "street",
"url": ""
}
]
},
"RandomPhoto": {
"//[enabled]": "Enables random link generation.",
"enabled": true
},
"Other": {
"customHTMLHead": "",
"enableCache": true,
"enableOnScrollRendering": true,
"defaultPhotoSortingMethod": "ascDate",
"//[enableDirectorySortingByDate]": "If enabled directories will be sorted by date, like photos, otherwise by name. Directory date is the last modification time of that directory not the creation date of the oldest photo",
"enableDirectorySortingByDate": false,
"enableOnScrollThumbnailPrioritising": true,
"NavBar": {
"showItemCount": true
},
"captionFirstNaming": false,
"enableDownloadZip": true,
"//[enableDirectoryFlattening]": "Adds a button to flattens the file structure, by listing the content of all subdirectories.",
"enableDirectoryFlattening": false
},
"authenticationRequired": true,
"unAuthenticatedUserRole": "Admin",
"Media": {
"Thumbnail": {
"iconSize": 45,
"personThumbnailSize": 200,
"thumbnailSizes": [
240,
480
]
},
"Video": {
"enabled": false
},
"Photo": {
"Converting": {
"enabled": true
},
"//[loadFullImageOnZoom]": "Enables loading the full resolution image on zoom in the ligthbox (preview).",
"loadFullImageOnZoom": true
}
},
"MetaFile": {
"//[gpx]": "Reads *.gpx files and renders them on the map.",
"gpx": false,
"//[markdown]": "Reads *.md files in a directory and shows the next to the map.",
"markdown": true,
"//[pg2conf]": "Reads *.pg2conf files (You can use it for custom sorting and save search (albums)).",
"pg2conf": true
},
"Faces": {
"enabled": false,
"keywordsToPersons": true,
"writeAccessMinRole": "Admin",
"readAccessMinRole": "User"
}
}
}
4/13/2022, 10:53:52 PM[SILLY][ThreadPool] Creating thread pool with 1 workers
4/13/2022, 10:53:52 PM[SILLY][ObjectManagers] Object manager reset begin
4/13/2022, 10:53:52 PM[DEBUG][ObjectManagers] Object manager reset
4/13/2022, 10:53:52 PM[DEBUG][SQLConnection] Creating connection: sqlite , with driver: better-sqlite3
4/13/2022, 10:53:52 PM[INFO_][JobManager] Running job schedules
4/13/2022, 10:53:52 PM[DEBUG][JobManager] skipping schedule:Indexing
4/13/2022, 10:53:52 PM[DEBUG][JobManager] skipping schedule:Preview Filling
4/13/2022, 10:53:52 PM[DEBUG][JobManager] skipping schedule:Thumbnail Generation
4/13/2022, 10:53:52 PM[DEBUG][JobManager] skipping schedule:Photo Converting
4/13/2022, 10:53:52 PM[DEBUG][JobManager] skipping schedule:Video Converting
4/13/2022, 10:53:52 PM[DEBUG][JobManager] skipping schedule:Temp Folder Cleaning
4/13/2022, 10:53:52 PM[DEBUG][ObjectManagers] SQL DB inited
4/13/2022, 10:53:52 PM[INFO_][server] Listening on port 8899
4/13/2022, 10:53:52 PM[DEBUG][ThreadPool] Worker 18 is online, worker count: 1
[Typeconfig] Loading config. Path: /app/data/config/config.json
[Typeconfig] Loading defaults from file: undefined
[Typeconfig] Loading defaults, def prefix: default
[Typeconfig] no default cli found among these: {
"expose": {
"gc": true
},
"config": {
"path": "/app/data/config/config.json"
},
"restart": "unless-stopped"
}
[Typeconfig] from env: {
"Server": {
"Database": {
"dbFolder": "/app/data/db"
},
"Media": {
"folder": "/app/data/images",
"tempFolder": "/app/data/tmp"
}
}
}
[Typeconfig] Processing cli and ENV inputs: {
"expose": {
"gc": true
},
"config": {
"path": "/app/data/config/config.json"
},
"restart": "unless-stopped"
}
[Typeconfig] Processing cli and ENV inputs: {
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HOSTNAME": "360cfe4c168b",
"NODE_ENV": "debug",
"NODE_VERSION": "14.19.0",
"YARN_VERSION": "1.22.17",
"PI_DOCKER": true,
"HOME": "/root",
"VIPS_MIN_STACK_SIZE": "2m",
"VIPSHOME": "/target"
}
NODE_ENV environmental variable is set to debug, forcing all logs to print
4/13/2022, 10:53:53 PM[DEBUG][Worker] Worker is waiting for tasks
4/13/2022, 10:55:57 PM[DEBUG] GET /gallery 200 55ms
4/13/2022, 10:55:57 PM[DEBUG] GET /assets/icon.png 304 19ms
4/13/2022, 10:55:57 PM[DEBUG] GET /styles.ab937cf3b433dd2b8120.css 200 61ms
4/13/2022, 10:55:57 PM[DEBUG] GET /scripts.3c3e9a19f3e3801f8abe.js 200 31ms
4/13/2022, 10:55:57 PM[DEBUG] GET /polyfills-es2015.671e3d6d9cc74c62b56c.js 200 46ms
4/13/2022, 10:55:57 PM[DEBUG] GET /runtime-es2015.ecf3e67b02343e346c3d.js 200 78ms
4/13/2022, 10:55:58 PM[DEBUG] GET /main-es2015.36eae00aed09bc9c6249.js 200 104ms
4/13/2022, 10:55:58 PM[VERBS] GET /api/notifications 200 26ms
4/13/2022, 10:55:58 PM[VERBS] GET /api/user/me 200 13ms
4/13/2022, 10:55:58 PM[VERBS] GET /api/gallery/content/ 200 41ms
4/13/2022, 10:55:58 PM[DEBUG] GET /assets/icon_inv.png 200 64ms
4/13/2022, 10:55:58 PM[VERBS] GET /api/gallery/content/barends/20220323_130628_2184.jpg/thumbnail/240 304 9ms
4/13/2022, 10:56:00 PM[VERBS] GET /api/user/list 200 11ms
4/13/2022, 10:56:01 PM[VERBS] GET /api/admin/statistic 200 16ms
4/13/2022, 10:56:01 PM[VERBS] GET /api/share/list 200 18ms
4/13/2022, 10:56:01 PM[VERBS] GET /api/admin/jobs/available 200 4ms
4/13/2022, 10:56:01 PM[VERBS] GET /api/admin/jobs/scheduled/progress 304 4ms
[Typeconfig] Loading defaults from file: undefined
[Typeconfig] Loading defaults, def prefix: default
[Typeconfig] no default cli found among these: {
"expose": {
"gc": true
},
"config": {
"path": "/app/data/config/config.json"
},
"restart": "unless-stopped"
}
[Typeconfig] from env: {
"Server": {
"Database": {
"dbFolder": "/app/data/db"
},
"Media": {
"folder": "/app/data/images",
"tempFolder": "/app/data/tmp"
}
}
}
[Typeconfig] Loading defaults from file: undefined
[Typeconfig] Loading defaults, def prefix: default
[Typeconfig] no default cli found among these: {
"expose": {
"gc": true
},
"config": {
"path": "/app/data/config/config.json"
},
"restart": "unless-stopped"
}
[Typeconfig] from env: {
"Server": {
"Database": {
"dbFolder": "/app/data/db"
},
"Media": {
"folder": "/app/data/images",
"tempFolder": "/app/data/tmp"
}
}
}
[Typeconfig] Processing cli and ENV inputs: {
"expose": {
"gc": true
},
"config": {
"path": "/app/data/config/config.json"
},
"restart": "unless-stopped"
}
[Typeconfig] Processing cli and ENV inputs: {
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HOSTNAME": "360cfe4c168b",
"NODE_ENV": "debug",
"NODE_VERSION": "14.19.0",
"YARN_VERSION": "1.22.17",
"PI_DOCKER": true,
"HOME": "/root",
"VIPS_MIN_STACK_SIZE": "2m",
"VIPSHOME": "/target"
}
4/13/2022, 10:56:01 PM[VERBS] GET /api/settings 200 226ms
[Typeconfig] Processing cli and ENV inputs: {
"expose": {
"gc": true
},
"config": {
"path": "/app/data/config/config.json"
},
"restart": "unless-stopped"
}
[Typeconfig] Processing cli and ENV inputs: {
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HOSTNAME": "360cfe4c168b",
"NODE_ENV": "debug",
"NODE_VERSION": "14.19.0",
"YARN_VERSION": "1.22.17",
"PI_DOCKER": true,
"HOME": "/root",
"VIPS_MIN_STACK_SIZE": "2m",
"VIPSHOME": "/target"
}
4/13/2022, 10:56:01 PM[VERBS] GET /api/settings 200 213ms
4/13/2022, 10:56:10 PM[VERBS] GET /api/admin/jobs/scheduled/progress 304 7ms
4/13/2022, 10:56:15 PM[VERBS] GET /api/admin/jobs/scheduled/progress 304 6ms
4/13/2022, 10:56:20 PM[VERBS] GET /api/admin/jobs/scheduled/progress 304 7ms
4/13/2022, 10:56:25 PM[VERBS] GET /api/admin/jobs/scheduled/progress 304 7ms
4/13/2022, 10:56:30 PM[VERBS] GET /api/admin/jobs/scheduled/progress 304 6ms
4/13/2022, 10:56:35 PM[VERBS] GET /api/admin/jobs/scheduled/progress 304 6ms
4/13/2022, 10:56:40 PM[VERBS] GET /api/admin/jobs/scheduled/progress 304 6ms
Environment (please complete the following information):
- OS: Raspberry Pi 4, up to date
- Usually Firefox
Used app version: docker-latest
https://github.com/docker/for-linux/issues/679 https://github.com/systemd/systemd/issues/6432
related issues. So I'm just trying to connect the dots between spammy logs and an unhealthy pigallery container.
confirming that disabling the healthcheck with
--no-healthcheck
eliminates the syslog spam
I will update bug title to reflect
That is expected given the healthcheck, cheks if the container runs on port 80:https://github.com/bpatrik/pigallery2/blob/e3bc01e41b71dfc1b45094ef254110042bd51040/docker/debian-buster/Dockerfile.build#L32-L34
If you want to expose a different port, you should map the port 80 to something else and not change it within the container.
You can also override the healthcheck in your docker-compose file. Note that the command you put in the healthcheck runs INSIDE the container. I moved my pigallery2 to port 81, and my title page contains the text "family photos", so the following healthcheck validates that my config was read and the web server is functional:
# cat docker-compose.yml
version: '3.7'
services:
pigallery2:
image: bpatrik/pigallery2:latest
container_name: pigallery2
environment:
- NODE_ENV=production
volumes:
- "/storage/pigallery2/config:/app/data/config"
- "db-data:/app/data/db"
- "/storage/pictures:/app/data/images"
- "/storage/pigallery2/tmp:/app/data/tmp"
ports:
- 81:81
restart: always
healthcheck:
test: wget -q http://127.0.0.1:81 -O - | egrep "family photos" > /dev/null
interval: 10s
timeout: 10s
retries: 3
start_period: 10s
volumes:
db-data:
closing this due to inactivity