Visitar URL original
Unable to connect to MariaDb/MySQL · Issue #319 · roapi/roapi · GitHub
Skip to content

Unable to connect to MariaDb/MySQL  #319

Description

@accforgithubtest

Hello there, and thank your for this interesting project!

I am looking to try out using roapi, with mariadb and getting the error below in logs.

Installation / setup is using docker compose (not swarm), on a ubuntu host machine on which mariadb is also running.
I have other applications running in my self hosted set up, and the database is working fine with the other applications with the same connection string.

Below are my docker-compose.yaml, roapi.yml and the logs I see.
Any help is greatly appreciated. TIA.

services:
  roapi:
    image: ghcr.io/roapi/roapi:latest
    container_name: roapi
    command: --config /config/roapi.yml
    environment:
      - RUST_BACKTRACE=1
    ports:
      - 8080
      - 5432
      - 32010
    volumes:
      - ./config:/config
addr:
  # binding address for TCP port that speaks HTTP protocol
  http: 0.0.0.0:8000
  # binding address for TCP port that speaks Postgres wire protocol
  postgres: 0.0.0.0:5432
  
# List All Data Sources
tables:

  - name: "testtbl"
    uri: "mysql://test:pwd1234@mariadb:3306/testtbl"
[2024-03-13T06:45:52Z INFO  roapi::context] loading `uri(mysql://test:pwd1234@mariadb:3306/testtbl)` as table `testtbl`
thread 'main' panicked at /roapi_src/roapi/src/startup.rs:63:14:
Failed to create Roapi context: Whatever { source: Some(TableError { source: Extension { msg: "unsupported extension in uri: mysql://test:pwd1234@mariadb:3306/testtbl" } }), message: "Failed to load table", backtrace: Backtrace(()) }
stack backtrace:
   0: rust_begin_unwind
             at ./rustc/20999de3a2f866a6006169c9bc188017aba79fcc/library/std/src/panicking.rs:619:5
   1: core::panicking::panic_fmt
             at ./rustc/20999de3a2f866a6006169c9bc188017aba79fcc/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at ./rustc/20999de3a2f866a6006169c9bc188017aba79fcc/library/core/src/result.rs:1652:5
   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

  1. accforgithubtest commented on Mar 18, 2024

    @accforgithubtest
    Author

    If anyone has got roapi working with MySql/MariaDb, any help is much appreciated.
    After a few more days of attempting a clean start from the examples, I am still facing the same issue.

  2. houqp commented on Mar 18, 2024

    @houqp
    Member

    @accforgithubtest the official image is not built with mysql feature enabled, you will need to build your own binary with the database-mysql feature with cargo.

  3. accforgithubtest commented on Mar 18, 2024

    @accforgithubtest
    Author

    @houqp - thanks for your reply !
    I couldn't find any docs on how this can be done (I am also not a developer, just learnt docker for self hosting purposes).

    Any chances you can add some doco on how to get a new docker image built with mysql enabled ?

  4. houqp commented on Mar 19, 2024

    @houqp
    Member

    You can try add the database-mysql flag in

    ARG FEATURES="simd,database"

  5. accforgithubtest commented on Mar 19, 2024

    @accforgithubtest
    Author

    thanks @houqp ! will give that a try.

    For my information - is there a reason why mysql is not enabled by default ? Is there a performance penalty ? or higher system requirements, etc ?

  6. houqp commented on Mar 19, 2024

    @houqp
    Member

    The only reason was we haven't had the time to make it work automatically with our current build and release pipeline. There shouldn't be any performance overhead.

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