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

Martin panics at start due to Postgres pool issue #1255

Open
Volatus opened this issue Mar 15, 2024 · 7 comments
Open

Martin panics at start due to Postgres pool issue #1255

Volatus opened this issue Mar 15, 2024 · 7 comments
Labels
bug pg Related to PostgreSQL sources

Comments

@Volatus
Copy link
Contributor

Volatus commented Mar 15, 2024

Happens with the latest version with both the macOS binary and the Docker image.

[2024-03-15T15:05:49Z ERROR martin] Unable to get a Postgres connection from the pool develop: Error occurred while creating a new object: db error: FATAL: SCRAM channel binding check failed
thread '<unnamed>' panicked at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/thread/local.rs:246:26:
cannot access a Thread Local Storage value during or after destruction: AccessError
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: tokio::task::local::Shared::schedule
   4: tokio::runtime::task::waker::wake_by_val
   5: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
   6: std::sys::common::thread_local::fast_local::destroy_value
   7: std::sys::unix::thread_local_dtor::register_dtor::run_dtors
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: thread local panicked on drop
zsh: abort      RUST_BACKTRACE=1 martin -c config.yml

The config is this, with values obfuscated

# Connection keep alive timeout [default: 75]
keep_alive: 75
listen_addresses: "0.0.0.0:3000"

postgres:
  connection_string: "postgresql://user:password@host:port/dbname?sslmode=require"
  default_srid: 4326
  auto_bounds: calc

  tables:
    cities:
      layer_id: cities
      schema: public
      table: some_materialized_view
      srid: 4326
      geometry_column: center_point
      id_column: id
      minzoom: 0
      maxzoom: 30
      bounds: [-180.0, -90.0, 180.0, 90.0]
      extent: 4096
      buffer: 64
      clip_geom: true
      geometry_type: GEOMETRY
      properties:
        id: integer
        z: double precision
        n: character varying

    timezones:
      layer_id: timezones
      schema: public
      table: timezones
      srid: 4326
      geometry_column: geom
      id_column: gid
      minzoom: 0
      maxzoom: 30
      bounds: [-180.0, -90.0, 180.0, 90.0]
      extent: 4096
      buffer: 64
      clip_geom: true
      geometry_type: GEOMETRY
      properties:
        gid: int4
        tzid: varchar

  functions:
    some_layer:
      layer_id: some_layer
      schema: public
      function: some_func_name
      minzoom: 0
      maxzoom: 30
      bounds: [-180.0, -90.0, 180.0, 90.0]

    some_layer:
      layer_id: some_layer
      schema: public
      function: some_func_name
      minzoom: 0
      maxzoom: 30
      bounds: [-180.0, -90.0, 180.0, 90.0]
@nyurik
Copy link
Member

nyurik commented Mar 15, 2024

@Volatus thx for reporting. Could you give some details on:

  • version of rust
  • version of Martin
  • version of postgres (and which platform it runs on) - i.e. select version()
  • operating system

@maplibre maplibre deleted a comment from Volatus Mar 15, 2024
@nyurik nyurik added bug pg Related to PostgreSQL sources labels Mar 15, 2024
@Volatus
Copy link
Contributor Author

Volatus commented Mar 15, 2024

@Volatus thx for reporting. Could you give some details on:

  • version of rust

  • version of Martin

  • version of postgres (and which platform it runs on) - i.e. select version()

  • operating system

Martin version is 0.13.0
OS is macOS 14.4
The target DB is running 16.2 on RDS

@nyurik
Copy link
Member

nyurik commented Mar 15, 2024

Really concerning, as this is not something I can easily reproduce. Would you be able to install Rust and try running cargo run -- <all your parameters> to see if the latest version has the same issues? I am hoping it is some upstream lib issue that has been resolved since I built v0.13

@nyurik
Copy link
Member

nyurik commented Mar 15, 2024

P.S. actually you can compile and install martin without cloning this repo first - just run cargo install --git https://github.com/maplibre/martin after you install rust (hopefully will compile without any other dependencies)

@kurotych
Copy link

kurotych commented Apr 1, 2024

I have the same problem after trying to migrate from 0.8.6 to 0.13 Martin on Ubuntu 20.04.6 LTS by using docker image

@kurotych
Copy link

kurotych commented Apr 1, 2024

The issue was resolved in the upstream version
image: ghcr.io/maplibre/martin:main

It'd be nice to have a new docker image with the tagged version with a fixed bug

@nyurik

@nyurik
Copy link
Member

nyurik commented Apr 1, 2024

Ah, thx, so it is working in the main, just not in the last release. I will try to release a version shortly, thx for validating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pg Related to PostgreSQL sources
Projects
None yet
Development

No branches or pull requests

3 participants