Skip to content

C# Connection Error:  #4475

Closed
Closed

Description

@JzhJay

FerretDB version

1.22

Backend

PostgreSQL

Environment

  • OS: Ubuntu 22.04
  • Deployment:
  • Deployment details:

What did you do?

My .NET service gets stuck at establishing the connection with FerretDB:
17:44:08.140 [Error] (Conning.GraphQL.GraphSchema.) System.AggregateException: One or more errors occurred. (Unable to authenticate using sasl protocol mechanism SCRAM-SHA-256.)
---> MongoDB.Driver.MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-256.
---> MongoDB.Driver.MongoConnectionException: An exception occurred while receiving a message from the server.
note: The new authentication SCRAM-SHA-256 is enabled -> FERRETDB_TEST_ENABLE_NEW_AUTH=true

I've taken a look at the FerretDB log and got the following:
2024-07-18T09:44:07.854Z ERROR // 172.19.0.1:50446 -> 172.19.0.3:27017 clientconn/conn.go:525 Handler error for unhandled response opcode {"error": "UnsupportedOpQueryCommand (352): Unsupported OP_QUERY command: saslContinue. The client driver may require an upgrade.", "opcode": "OP_REPLY"}
github.com/FerretDB/FerretDB/internal/clientconn.(*conn).route
/src/internal/clientconn/conn.go:525
github.com/FerretDB/FerretDB/internal/clientconn.(*conn).run
/src/internal/clientconn/conn.go:316
github.com/FerretDB/FerretDB/internal/clientconn.acceptLoop.func1
/src/internal/clientconn/listener.go:305
2024-07-18T09:44:07.854Z ERROR // 172.19.0.1:50446 -> 172.19.0.3:27017 clientconn/conn.go:615 Response header: length: 0, id: 0, response_to: 0, opcode: OP_REPLY
github.com/FerretDB/FerretDB/internal/clientconn.(*conn).logResponse
/src/internal/clientconn/conn.go:615
github.com/FerretDB/FerretDB/internal/clientconn.(*conn).run
/src/internal/clientconn/conn.go:317
github.com/FerretDB/FerretDB/internal/clientconn.acceptLoop.func1
/src/internal/clientconn/listener.go:305
2024-07-18T09:44:07.854Z ERROR // 172.19.0.1:50446 -> 172.19.0.3:27017 clientconn/conn.go:616 Response message:
%!s()

github.com/FerretDB/FerretDB/internal/clientconn.(*conn).logResponse
/src/internal/clientconn/conn.go:616
github.com/FerretDB/FerretDB/internal/clientconn.(*conn).run
/src/internal/clientconn/conn.go:317
github.com/FerretDB/FerretDB/internal/clientconn.acceptLoop.func1
/src/internal/clientconn/listener.go:305
2024-07-18T09:44:07.854Z DPANIC // 172.19.0.1:50446 -> 172.19.0.3:27017 clientconn/conn.go:170 no response to send to client
(err = )
github.com/FerretDB/FerretDB/internal/clientconn.(*conn).run.func3
/src/internal/clientconn/conn.go:170
runtime.gopanic
/usr/local/go/src/runtime/panic.go:770
github.com/FerretDB/FerretDB/internal/clientconn.(*conn).run
/src/internal/clientconn/conn.go:376
github.com/FerretDB/FerretDB/internal/clientconn.acceptLoop.func1
/src/internal/clientconn/listener.go:305
2024-07-18T09:44:07.854Z WARN listener clientconn/listener.go:310 Connection stopped {"conn": "172.19.0.1:50446 -> 172.19.0.3:27017", "error": "panic"}

What did you expect to see?

My .NET service can establish the connection with FerretDB then execute some mongo queries on the flight

What did you see instead?

Errors shown as above

Activity

  1. added
    code/bugSome user-visible feature works incorrectly
    not readyIssues that are not ready to be worked on; PRs that should skip CI
    on Jul 18, 2024
  2. JzhJay commented on Jul 18, 2024

    @JzhJay
    Author

    My C# Mongo Client driver is up to date: V2.27

  3. added
    area/authIssues about authentication and authorization
    on Jul 22, 2024
  4. Spoomer commented on Aug 24, 2024

    @Spoomer

    Hey,
    I think mongodb changed something in the mongodb driver. On my machine after I updated the driver from 2.24 to 2.28 FerretDb gets an empty Username and can't connect to postgres. After downgrading the driver to 2.24 the error was gone. Maybe it's the same in your case. You can check the postgres logs if the auth fails because of an empty username or "ferretdb" (I think its now the ferretdb default if no username is provided) as user.

  5. AlekSi commented on Aug 26, 2024

    @AlekSi
    Member

    We plan to fix this issue in the next release (planned for this week)

  6. added this to the Next milestone on Aug 26, 2024
  7. AlekSi commented on Aug 28, 2024

    @AlekSi
    Member

    v1.24.0 is out with the fix for that issue. Please let us know if it works for you.

  8. added a commit that references this issue on Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/authIssues about authentication and authorizationcode/bugSome user-visible feature works incorrectlynot readyIssues that are not ready to be worked on; PRs that should skip CI

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions