Skip to content

Unable to connect to sqlite  #354

Description

@accforgithubtest

I used docker to set up roapi and it is connecting fine to the example spacex_launches json and github_jobs json.

I tried to connect it to my pihole sqlite database, and I am not able to connect to it.
I have checked multiples times and the path to the database is correct.

Docker compose file -

services:
  roapi:
    image: ghcr.io/roapi/roapi:${version_latest}
    container_name: roapi
    command: --config /config/roapi.yml
    environment:
      - RUST_BACKTRACE=1
    ports:
      - 8080
      - 5432
      - 32010
    volumes:
      - ./config:/config
      - <path to my pihole folder>:/pihole:ro

Config roapi.yaml -

addr:
  http: 0.0.0.0:8080
  postgres: 0.0.0.0:5432
  
# List All Data Sources
tables:
  - name: "pihole"
    uri: "sqlite:///pihole/pihole-FTL.db"
  - name: "spacex_launches"
    uri: "https://api.spacexdata.com/v4/launches"
    option:
      format: "json"
  - name: "github_jobs"
    uri: "https://web.archive.org/web/20210507025928if_/https://jobs.github.com/positions.json"

Logs -

[2024-12-12T04:11:24Z INFO  roapi::context] loading `uri(sqlite:///pihole/pihole-FTL.db)` as table `pihole`
thread 'main' panicked at /roapi_src/roapi/src/startup.rs:63:14:
Failed to create Roapi context: Whatever { source: Some(TableError { source: LoadDatabase { source: Destination { source: SQLiteArrowTransportError(Source(SQLiteError(SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("no such table: pihole"))))) } } }), message: "Failed to load table", backtrace: Backtrace(()) }
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: roapi::startup::Application::build::{{closure}}
   4: roapi::main::{{closure}}
   5: roapi::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions