[GH-ISSUE #6] Error: ParseIntError #5

Closed
opened 2026-02-27 10:15:14 +03:00 by kerem · 3 comments
Owner

Originally created by @loranger on GitHub (Sep 30, 2022).
Original GitHub issue: https://github.com/matze/wastebin/issues/6

Hello,

I try to make wastebin running from docker-compose (under a reverse-proxy). Here is my setup:

.env
APP_NAME="Waste Bin"
APP_PROJECT=wastebin
APP_DOMAIN=wastebin.docker
APP_URL="http://${APP_DOMAIN}"

WASTEBIN_ADDRESS_PORT=80
WASTEBIN_CACHE_SIZE=128
WASTEBIN_DATABASE_PATH="/var/wastebin.db"
WASTEBIN_MAX_BODY_SIZE="1MB"
WASTEBIN_TITLE=${APP_NAME}
RUST_LOG=debug
docker-compose.yml
version: '3'
services:
  wastebin:
    image: quxfoo/wastebin:latest
    container_name: ${APP_PROJECT}-wastebin
    env_file:
        - .env
    volumes:
      - ./datas:/var
    restart: unless-stopped
    # ports:
    #   - 8888:80
    labels:
      - "traefik.http.routers.${APP_PROJECT}-wastebin.rule=Host(`${APP_URL}`)"
      - "traefik.http.services.${APP_PROJECT}-wastebin-service.loadbalancer.server.port=${WASTEBIN_ADDRESS_PORT}"

networks:
  default:
      name: web

I did struggle with sqlite permissions, but I fixed the issue by mounting a writeable folder instead of the sqlite file itself (even if the database file is also writeable)

$ mkdir -p datas
$ touch datas/wastebin.db
$ chmod -R a+w datas

Then I up the service and database is found, opened and migrations are applied, but then it fails on a ParseIntError

docker-compose up
[+] Running 1/0
 ⠿ Container wastebin-wastebin  Recreated                                  0.1s
Attaching to wastebin-wastebin
wastebin-wastebin  | 2022-09-30T17:01:28.319233Z DEBUG wastebin::db: opening Path("/var/wastebin.db")
wastebin-wastebin  | 2022-09-30T17:01:28.330575Z DEBUG rusqlite_migration: some migrations defined, try to migrate
wastebin-wastebin  | 2022-09-30T17:01:28.334326Z DEBUG rusqlite_migration: some migrations to run, target_db_version: 2, current_version: 0
wastebin-wastebin  | 2022-09-30T17:01:28.334776Z DEBUG rusqlite_migration: Running: CREATE TABLE entries(
wastebin-wastebin  |     id INTEGER PRIMARY KEY,
wastebin-wastebin  |     text TEXT NOT NULL,
wastebin-wastebin  |     burn_after_reading INTEGER,
wastebin-wastebin  |     expires TEXT
wastebin-wastebin  | );
wastebin-wastebin  |
wastebin-wastebin  | 2022-09-30T17:01:28.351768Z DEBUG rusqlite_migration: Running: ALTER TABLE entries ADD COLUMN created_at TEXT;
wastebin-wastebin  |
wastebin-wastebin  | UPDATE entries SET created_at=datetime('1970-01-01 00:00:00');
wastebin-wastebin  |
wastebin-wastebin  | 2022-09-30T17:01:28.359568Z  INFO rusqlite_migration: Database migrated to version 2
wastebin-wastebin  | Error: ParseIntError { kind: InvalidDigit }
wastebin-wastebin exited with code 1
wastebin-wastebin  | 2022-09-30T17:01:28.656706Z DEBUG wastebin::db: opening Path("/var/wastebin.db")
wastebin-wastebin  | 2022-09-30T17:01:28.665385Z DEBUG rusqlite_migration: some migrations defined, try to migrate
wastebin-wastebin  | 2022-09-30T17:01:28.669484Z DEBUG rusqlite_migration: no migration to run, db already up to date
wastebin-wastebin  | Error: ParseIntError { kind: InvalidDigit }
wastebin-wastebin exited with code 1

What did I miss ?

Originally created by @loranger on GitHub (Sep 30, 2022). Original GitHub issue: https://github.com/matze/wastebin/issues/6 Hello, I try to make wastebin running from docker-compose (under a reverse-proxy). Here is my setup: <details> <summary>.env</summary> ``` APP_NAME="Waste Bin" APP_PROJECT=wastebin APP_DOMAIN=wastebin.docker APP_URL="http://${APP_DOMAIN}" WASTEBIN_ADDRESS_PORT=80 WASTEBIN_CACHE_SIZE=128 WASTEBIN_DATABASE_PATH="/var/wastebin.db" WASTEBIN_MAX_BODY_SIZE="1MB" WASTEBIN_TITLE=${APP_NAME} RUST_LOG=debug ``` </details> <details> <summary>docker-compose.yml</summary> ```yaml version: '3' services: wastebin: image: quxfoo/wastebin:latest container_name: ${APP_PROJECT}-wastebin env_file: - .env volumes: - ./datas:/var restart: unless-stopped # ports: # - 8888:80 labels: - "traefik.http.routers.${APP_PROJECT}-wastebin.rule=Host(`${APP_URL}`)" - "traefik.http.services.${APP_PROJECT}-wastebin-service.loadbalancer.server.port=${WASTEBIN_ADDRESS_PORT}" networks: default: name: web ``` </details> I did struggle with sqlite permissions, but I fixed the issue by mounting a writeable folder instead of the sqlite file itself (even if the database file is also writeable) ```shell $ mkdir -p datas $ touch datas/wastebin.db $ chmod -R a+w datas ``` Then I up the service and database is found, opened and migrations are applied, but then it fails on a ParseIntError ``` docker-compose up [+] Running 1/0 ⠿ Container wastebin-wastebin Recreated 0.1s Attaching to wastebin-wastebin wastebin-wastebin | 2022-09-30T17:01:28.319233Z DEBUG wastebin::db: opening Path("/var/wastebin.db") wastebin-wastebin | 2022-09-30T17:01:28.330575Z DEBUG rusqlite_migration: some migrations defined, try to migrate wastebin-wastebin | 2022-09-30T17:01:28.334326Z DEBUG rusqlite_migration: some migrations to run, target_db_version: 2, current_version: 0 wastebin-wastebin | 2022-09-30T17:01:28.334776Z DEBUG rusqlite_migration: Running: CREATE TABLE entries( wastebin-wastebin | id INTEGER PRIMARY KEY, wastebin-wastebin | text TEXT NOT NULL, wastebin-wastebin | burn_after_reading INTEGER, wastebin-wastebin | expires TEXT wastebin-wastebin | ); wastebin-wastebin | wastebin-wastebin | 2022-09-30T17:01:28.351768Z DEBUG rusqlite_migration: Running: ALTER TABLE entries ADD COLUMN created_at TEXT; wastebin-wastebin | wastebin-wastebin | UPDATE entries SET created_at=datetime('1970-01-01 00:00:00'); wastebin-wastebin | wastebin-wastebin | 2022-09-30T17:01:28.359568Z INFO rusqlite_migration: Database migrated to version 2 wastebin-wastebin | Error: ParseIntError { kind: InvalidDigit } wastebin-wastebin exited with code 1 wastebin-wastebin | 2022-09-30T17:01:28.656706Z DEBUG wastebin::db: opening Path("/var/wastebin.db") wastebin-wastebin | 2022-09-30T17:01:28.665385Z DEBUG rusqlite_migration: some migrations defined, try to migrate wastebin-wastebin | 2022-09-30T17:01:28.669484Z DEBUG rusqlite_migration: no migration to run, db already up to date wastebin-wastebin | Error: ParseIntError { kind: InvalidDigit } wastebin-wastebin exited with code 1 ``` What did I miss ?
kerem closed this issue 2026-02-27 10:15:15 +03:00
Author
Owner

@matze commented on GitHub (Sep 30, 2022):

I suppose

WASTEBIN_MAX_BODY_SIZE="1MB"

It's given in number of bytes. So, you rather want WASTEBIN_MAX_BODY_SIZE=1048576 or just leave it at the default which is also 1MB.

P.S.: but I will try to enhance the error message with more context.

<!-- gh-comment-id:1263820374 --> @matze commented on GitHub (Sep 30, 2022): I suppose > WASTEBIN_MAX_BODY_SIZE="1MB" It's given in number of bytes. So, you rather want `WASTEBIN_MAX_BODY_SIZE=1048576` or just leave it at the default which is also 1MB. P.S.: but I will try to enhance the error message with more context.
Author
Owner

@loranger commented on GitHub (Sep 30, 2022):

Thanks for the fast answer.

You were right the problem came from the BODY_SIZE. I should have read more carefully the README file.

Now there an issue with the socket :

docker-compose up
[+] Running 1/0
 ⠿ Container wastebin-wastebin  Created                                    0.0s
Attaching to wastebin-wastebin
wastebin-wastebin  | 2022-09-30T17:16:01.085588Z DEBUG wastebin::db: opening Path("/var/wastebin.db")
wastebin-wastebin  | 2022-09-30T17:16:01.094334Z DEBUG rusqlite_migration: some migrations defined, try to migrate
wastebin-wastebin  | 2022-09-30T17:16:01.097809Z DEBUG rusqlite_migration: some migrations to run, target_db_version: 2, current_version: 0
wastebin-wastebin  | 2022-09-30T17:16:01.098251Z DEBUG rusqlite_migration: Running: CREATE TABLE entries(
wastebin-wastebin  |     id INTEGER PRIMARY KEY,
wastebin-wastebin  |     text TEXT NOT NULL,
wastebin-wastebin  |     burn_after_reading INTEGER,
wastebin-wastebin  |     expires TEXT
wastebin-wastebin  | );
wastebin-wastebin  |
wastebin-wastebin  | 2022-09-30T17:16:01.114416Z DEBUG rusqlite_migration: Running: ALTER TABLE entries ADD COLUMN created_at TEXT;
wastebin-wastebin  |
wastebin-wastebin  | UPDATE entries SET created_at=datetime('1970-01-01 00:00:00');
wastebin-wastebin  |
wastebin-wastebin  | 2022-09-30T17:16:01.121806Z  INFO rusqlite_migration: Database migrated to version 2
wastebin-wastebin  | 2022-09-30T17:16:01.122329Z DEBUG wastebin: serving on 80
wastebin-wastebin  | 2022-09-30T17:16:01.122412Z DEBUG wastebin: caching 128 paste highlights
wastebin-wastebin  | 2022-09-30T17:16:01.122503Z DEBUG wastebin: restricting maximum body size to 1048576 bytes
wastebin-wastebin  | Error: AddrParseError(Socket)
wastebin-wastebin exited with code 1
<!-- gh-comment-id:1263831540 --> @loranger commented on GitHub (Sep 30, 2022): Thanks for the fast answer. You were right the problem came from the BODY_SIZE. I should have read more carefully the README file. Now there an issue with the socket : ``` docker-compose up [+] Running 1/0 ⠿ Container wastebin-wastebin Created 0.0s Attaching to wastebin-wastebin wastebin-wastebin | 2022-09-30T17:16:01.085588Z DEBUG wastebin::db: opening Path("/var/wastebin.db") wastebin-wastebin | 2022-09-30T17:16:01.094334Z DEBUG rusqlite_migration: some migrations defined, try to migrate wastebin-wastebin | 2022-09-30T17:16:01.097809Z DEBUG rusqlite_migration: some migrations to run, target_db_version: 2, current_version: 0 wastebin-wastebin | 2022-09-30T17:16:01.098251Z DEBUG rusqlite_migration: Running: CREATE TABLE entries( wastebin-wastebin | id INTEGER PRIMARY KEY, wastebin-wastebin | text TEXT NOT NULL, wastebin-wastebin | burn_after_reading INTEGER, wastebin-wastebin | expires TEXT wastebin-wastebin | ); wastebin-wastebin | wastebin-wastebin | 2022-09-30T17:16:01.114416Z DEBUG rusqlite_migration: Running: ALTER TABLE entries ADD COLUMN created_at TEXT; wastebin-wastebin | wastebin-wastebin | UPDATE entries SET created_at=datetime('1970-01-01 00:00:00'); wastebin-wastebin | wastebin-wastebin | 2022-09-30T17:16:01.121806Z INFO rusqlite_migration: Database migrated to version 2 wastebin-wastebin | 2022-09-30T17:16:01.122329Z DEBUG wastebin: serving on 80 wastebin-wastebin | 2022-09-30T17:16:01.122412Z DEBUG wastebin: caching 128 paste highlights wastebin-wastebin | 2022-09-30T17:16:01.122503Z DEBUG wastebin: restricting maximum body size to 1048576 bytes wastebin-wastebin | Error: AddrParseError(Socket) wastebin-wastebin exited with code 1 ```
Author
Owner

@loranger commented on GitHub (Sep 30, 2022):

Ok, like WASTEBIN_MAX_BODY_SIZE, WASTEBIN_ADDRESS_PORT must follow a specific format, must contain the listening ip and cannot have just the port.

Here is my complete working setup, for anyone interested in.

.env
APP_NAME="Waste Bin"
APP_PROJECT=wastebin
APP_DOMAIN=wastebin.docker
APP_URL="http://${APP_DOMAIN}"

WASTEBIN_PORT=80
WASTEBIN_ADDRESS_PORT=0.0.0.0:${WASTEBIN_PORT}
WASTEBIN_CACHE_SIZE=128
WASTEBIN_DATABASE_PATH="/var/wastebin.db"
WASTEBIN_MAX_BODY_SIZE=1048576
WASTEBIN_TITLE=${APP_NAME}
RUST_LOG=debug
docker-compose.yml
version: '3'
services:
  wastebin:
    image: quxfoo/wastebin:latest
    container_name: ${APP_PROJECT}-wastebin
    env_file:
        - .env
    volumes:
      - ./datas:/var
    restart: unless-stopped
    labels:
      - "traefik.http.routers.${APP_PROJECT}.rule=Host(`${APP_DOMAIN}`)"
      - "traefik.http.services.${APP_PROJECT}-service.loadbalancer.server.port=${WASTEBIN_PORT:-8088}"

networks:
  default:
      name: web

Thanks for your support and this awesome project, @matze

<!-- gh-comment-id:1263849776 --> @loranger commented on GitHub (Sep 30, 2022): Ok, like `WASTEBIN_MAX_BODY_SIZE`, `WASTEBIN_ADDRESS_PORT` must follow a specific format, must contain the listening ip and cannot have just the port. Here is my complete working setup, for anyone interested in. <details> <summary>.env</summary> ``` APP_NAME="Waste Bin" APP_PROJECT=wastebin APP_DOMAIN=wastebin.docker APP_URL="http://${APP_DOMAIN}" WASTEBIN_PORT=80 WASTEBIN_ADDRESS_PORT=0.0.0.0:${WASTEBIN_PORT} WASTEBIN_CACHE_SIZE=128 WASTEBIN_DATABASE_PATH="/var/wastebin.db" WASTEBIN_MAX_BODY_SIZE=1048576 WASTEBIN_TITLE=${APP_NAME} RUST_LOG=debug ``` </details> <details> <summary>docker-compose.yml</summary> ```yaml version: '3' services: wastebin: image: quxfoo/wastebin:latest container_name: ${APP_PROJECT}-wastebin env_file: - .env volumes: - ./datas:/var restart: unless-stopped labels: - "traefik.http.routers.${APP_PROJECT}.rule=Host(`${APP_DOMAIN}`)" - "traefik.http.services.${APP_PROJECT}-service.loadbalancer.server.port=${WASTEBIN_PORT:-8088}" networks: default: name: web ``` </details> Thanks for your support and this awesome project, @matze
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wastebin-matze#5
No description provided.