Skip to content

[Self-Host] It shows "Cannot open database" while working successfully. #54

@GinWineLi

Description

@GinWineLi

I use docker compose to deploy it. It will show the error that "scrape-cheerio-1 | ERROR Error in periodic finalization check: TypeError: Cannot open database because the directory does not exist" in logs. But it can work successfully.

Image

this is my docker-compose.yml

name: anycrawl

x-common-service: &common-service
  networks:
    - anycrawl-network
  volumes:
    - ./storage:/usr/src/app/storage

x-common-env: &common-env
  NODE_ENV: ${NODE_ENV:-production}
  ANYCRAWL_HEADLESS: ${ANYCRAWL_HEADLESS:-true}
  ANYCRAWL_PROXY_URL: ${ANYCRAWL_PROXY_URL:-}
  ANYCRAWL_IGNORE_SSL_ERROR: ${ANYCRAWL_IGNORE_SSL_ERROR:-true}
  ANYCRAWL_REDIS_URL: ${ANYCRAWL_REDIS_URL:-redis://redis:6379}
  ANYCRAWL_API_PORT: ${ANYCRAWL_API_PORT:-8080}
  ANYCRAWL_API_AUTH_ENABLED: ${ANYCRAWL_API_AUTH_ENABLED:-false}
  ANYCRAWL_API_DB_TYPE: "sqlite"
  ANYCRAWL_API_DB_CONNECTION: "/usr/src/app/db/database.db"

services:
  api:
    <<: *common-service
    image: ghcr.io/any4ai/anycrawl-api
    environment:
      <<: *common-env
    ports:
      - "6210:8080"
    volumes:
      - ./storage:/usr/src/app/storage
      - ./db:/usr/src/app/db
    depends_on:
      - redis

  scrape-puppeteer:
    <<: *common-service
    image: ghcr.io/any4ai/anycrawl-scrape-puppeteer
    environment:
      <<: *common-env
    depends_on:
      - redis
  scrape-playwright:
    <<: *common-service
    image: ghcr.io/any4ai/anycrawl-scrape-playwright
    environment:
      <<: *common-env
    depends_on:
      - redis

  scrape-cheerio:
    <<: *common-service
    image: ghcr.io/any4ai/anycrawl-scrape-cheerio
    environment:
      <<: *common-env
    depends_on:
      - redis
  redis:
    image: redis:7-alpine
    volumes:
      - ./redis-data:/data
    networks:
      - anycrawl-network
    command: redis-server --appendonly yes

networks:
  anycrawl-network:
          driver: bridge

And I am sure I have given the "db" folder 777 permition.

Metadata

Metadata

Assignees

Labels

DockerbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions