Skip to content

[Bug]: #1923

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

Open
2 tasks done
fabiang opened this issue Mar 10, 2025 · 0 comments
Open
2 tasks done

[Bug]: #1923

fabiang opened this issue Mar 10, 2025 · 0 comments
Labels
support request request for free support. Check out our support policy

Comments

@fabiang
Copy link

fabiang commented Mar 10, 2025

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration issue.
  • This issue is not already reported on Github (I've searched it).

Bug description

Hello,

I'm currently trying to use multiple auth plugins with STPGo, to figure out if it's possible to have two different authentication methods. For testing-purposes I'm trying to configure the sftpgo/sftpgo-plugin-auth plugin twice. If I'm trying to do this the authentication plugins are crashing.

My ultimate goal is write a auth plugin for SFTPGo.

Steps to reproduce

  1. configure the auth plugin twice
  2. try to authenticate user
  3. WebUI says "Invalid credentials, please retry"
  4. plugin crash
  5. remove second plugin
  6. authentication is working

Expected behavior

Support for multiple auth plugins

SFTPGo version

2.6.6

Data provider

postgresql

Installation method

Community Docker image

Configuration

Dockerfile:

ARG VERSION=v2.6
FROM drakkan/sftpgo:${VERSION}-plugins

# Assume a valid ldap config file
COPY ./config/ldap1.conf /etc/sftpgo/ldap1.conf

Docker-Compose:

services:
  sftpgo:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "2022:2022"
      - "8080:8080"
    environment:
      SFTPGO_GRACE_TIME: 32
      SFTPGO_PLUGINS__0__TYPE: auth
      SFTPGO_PLUGINS__0__AUTH_OPTIONS__SCOPE: 5
      SFTPGO_PLUGINS__0__CMD: /usr/local/bin/sftpgo-plugin-auth
      SFTPGO_PLUGINS__0__ARGS: serve,--config-file,/etc/sftpgo/ldap1.conf
      SFTPGO_PLUGINS__0__AUTO_MTLS: 0
      SFTPGO_PLUGINS__1__TYPE: auth
      SFTPGO_PLUGINS__1__AUTH_OPTIONS__SCOPE: 5
      SFTPGO_PLUGINS__1__CMD: /usr/local/bin/sftpgo-plugin-auth
      SFTPGO_PLUGINS__1__ARGS: serve,--config-file,/etc/sftpgo/ldap1.conf
      SFTPGO_PLUGINS__1__AUTO_MTLS: 0

Relevant log output

{"username":"","login_type":"password","protocol":"HTTP","error":"plugin auth error for user \"fabian.grutschus\": rpc error: code = Unavailable desc = connection error: desc = \"transport: error while dialing: dial unix /tmp/plugin1458069910: connect: connection refused\", elapsed: 79.031µs, auth scope: 1"}
{"sender":"plugins","message":"try to restart crashed auth plugin \"/usr/local/bin/sftpgo-plugin-auth\", idx: 0"}
{"sender":"plugins","message":"killed process /usr/local/bin/sftpgo-plugin-auth, pid 27, err <nil>"}
{"sender":"plugins","message":"create new auth plugin \"/usr/local/bin/sftpgo-plugin-auth\""}
{"sender":"plugins","message":"adding env vars with prefix \"SFTPGO_PLUGIN_AUTH_\" for plugin \"/usr/local/bin/sftpgo-plugin-auth\""}
{"sender":"plugins","message":"additional env vars for plugin \"/usr/local/bin/sftpgo-plugin-auth\": []"}
{"sender":"plugins.auth","path":"/usr/local/bin/sftpgo-plugin-auth","pid":"42","message":"plugin started"}
{"sender":"plugins.auth","plugin":"/usr/local/bin/sftpgo-plugin-auth","message":"waiting for RPC address"}
{"sender":"plugins.auth","plugin":"/usr/local/bin/sftpgo-plugin-auth","id":"27","error":"signal: killed","message":"plugin process exited"}
{"sender":"plugins.auth.stdio","err":"rpc error: code = Canceled desc = context canceled","message":"received EOF, stopping recv loop"}
{"sender":"plugins.auth.sftpgo-plugin-auth","message":"[INFO]  authenticator created: dial URLs=[\"<redacted>\"] base dn=\"<redacted>\""}
{"sender":"plugins.auth.sftpgo-plugin-auth","message":"[DEBUG] multi authenticator initialized: LDAP servers=1 cache size=100"}
{"sender":"plugins.auth","version":"1","message":"using plugin"}
{"sender":"plugins.auth.sftpgo-plugin-auth","address":"/tmp/plugin694026016","network":"unix","message":"plugin address"}
{"sender":"plugins.auth.stdio","message":"waiting for stdio data"}

What are you using SFTPGo for?

Medium business

Additional info

No response

@fabiang fabiang added the bug Something isn't working label Mar 10, 2025
@drakkan drakkan added support request request for free support. Check out our support policy and removed bug Something isn't working labels Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support request request for free support. Check out our support policy
Projects
None yet
Development

No branches or pull requests

2 participants