Skip to content

failed to authenticate: User not found or supplied credentials are invalid #482

@ahmadhabibi14

Description

@ahmadhabibi14

I'm pretty sure that my config was alreary right, I've tried to connect with CLI and it works, but it why it doesn't work via Go ?

Connect with Go

package tt_custom

import (
	"context"
	"testing"
	"time"

	"github.com/tarantool/go-tarantool/v3"
)

func TestConnectTarantool(t *testing.T) {
	dialer := tarantool.NetDialer{
		Address:  "127.0.0.1:3304",
		User:     "tacticdT",
		Password: "tacticdPT",
	}
	opts := tarantool.Opts{
		Timeout: 8 * time.Second,
	}

	conn, err := tarantool.Connect(context.Background(), dialer, opts)
	if err != nil {
		t.Error(err, "Connection refused")
		return
	}

	data, err := conn.Do(
		tarantool.NewInsertRequest(999).Tuple([]interface{}{99999, "BB"})).Get()
	if err != nil {
		t.Error(err, "failed to insert data")
	} else {
		t.Log(data, "data inserted")
	}
}

Test result:

❯ go test -v ./tt_custom                                                                                                                                                                                                          ─╯
=== RUN   TestConnectTarantool
    tarantool_adapter_test.go:23: failed to authenticate: User not found or supplied credentials are invalid (ClientError, code 0x2f), see ./src/box/authentication.c line 117 Connection refused
--- FAIL: TestConnectTarantool (0.00s)
FAIL
FAIL    tacticduar/tt_custom    0.007s
FAIL

Docker compose config:

services:
  tarantool:
    image: tarantool/tarantool:3.5.0
    container_name: tacticduar-tarantool
    environment:
      TARANTOOL_USER_NAME: "tacticdT"
      TARANTOOL_USER_PASSWORD: "tacticdPT"
      TT_READAHEAD: '1632000' # 10x
      TT_VINYL_MEMORY: '268435456' # 20x
      TT_VINYL_CACHE: '2684354560' # 20x
      TT_NET_MSG_MAX: '76800' # 100x
      TT_MEMTX_MEMORY: '268435456' # 1x
      TT_VINYL_PAGE_SIZE: '8192' # 1x
      TT_FORCE_RECOVERY: 'true'
    volumes:
      - ./_tmpdb/var_lib_tarantool:/var/lib/tarantool
    ports:
      - "3304:3301"

Connect with CLI

❯ docker exec -it tacticduar-tarantool console tacticdT:tacticdPT@127.0.0.1:3304                                                                 ─╯
   • Connecting to the instance...
   • Connected to /var/run/tarantool/sys_env/default/instance-001/tarantool.control

/var/run/tarantool/sys_env/default/instance-001/tarantool.control> 

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