Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to MariaDb/MySQL #319

Open
accforgithubtest opened this issue Mar 13, 2024 · 6 comments
Open

Unable to connect to MariaDb/MySQL #319

accforgithubtest opened this issue Mar 13, 2024 · 6 comments

Comments

@accforgithubtest
Copy link

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.
      
@accforgithubtest
Copy link
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.

@houqp
Copy link
Member

houqp commented Mar 18, 2024

@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.

@accforgithubtest
Copy link
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 ?

@houqp
Copy link
Member

houqp commented Mar 19, 2024

You can try add the database-mysql flag in

ARG FEATURES="simd,database"

@accforgithubtest
Copy link
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 ?

@houqp
Copy link
Member

houqp commented Mar 19, 2024

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants