Skip to content

the api /v2/job/reverse panic when is_mysql_password_encrypted set true #756

@asiroliu

Description

@asiroliu

Description

Steps to reproduce the issue

  1. enable rsa_private_key_path
  2. create job test-migration
  3. create reverse job for test-migration
{
  "job_id": "test-migration",
  "reverse_config": {
    "src_user": "test_src",
    "src_pwd": "Kq5Dxo+RvJOl2sn5/onGKKMlFDv8P2D49VqYwAYM83xfi360PSfpnOnP6UMRL18Y8ZxQh3lxd5JyZ2mCm2q0FkOPZoJXdtmQiNaF5NXchSFF4Di4ZRCfhe44GnEqxNxpIvIoP0Mkk0+oG4uZlBTWB6rKCwkR7JlLx5uqzM1slYqX0glMGcH4q0RAV/uiG5XAv4QlBeVoQNDJwqCHvO3S/xEdOs80oBko7Cu4tYotd2Ck2lV9OM6uJVvqTdxZ5e8+sMLuAjlogQpgwNdySfDa2gWnW5FkAaiqqRa6WMXgX7QEPeZe445BO2g4tUhvBf17yT6Rlb+LPM/gkmbLLzEiAg==",
    "dest_user": "test_dest",
    "dst_pwd": "HBnMjqa5QFP1LoRLH6AZgzKjMgxqajxQyy/F5t1BWYeg8DaO3WfX0+wF0g62KXW54JwjkMen/dgYw4DyMEipHlVaaUJNl4hYLeJ9Zi0midFljFBnulsZgM2jRDNYx/gRyQyrzG/AW1SK70mVcn0rSkfmPLUQGNFdUvGUqYlwmebHNZZ+0g1RUspLlQYTRkk9q5FWwxBEnZFkRa5HYpkBSS+zdLQO/k2LFDuY8UgBadsWzB2s4A8wFynRe3Oxazqifg/BjjhCkToyPbJxodQAUjJwbgGs4W7ZaDZkCVrW8TX/1RCfpVhd1oaFtBq897uxdTHNPy34jlC5ZSuZAeyE7Q==",
    "is_mysql_password_encrypted": true
  }
}
  1. the dtle panic
2021-08-10T14:37:28.759+0800 [DEBUG] client.driver_mgr.dtle: http: panic serving 192.168.2.45:55789: runtime error: invalid memory address or nil pointer dereference
goroutine 540 [running]:
net/http.(*conn).serve.func1(0xc001d5b360)
        /opt/go/src/net/http/server.go:1772 +0x139
panic(0x1c49160, 0x3fba310)
        /opt/go/src/runtime/panic.go:975 +0x3e3
github.com/actiontech/dtle/drivers/api/handler/v2.ReverseJob(0x239f980, 0xc001d5b400, 0x4, 0x1c52880)
        /universe/src/github.com/actiontech/dtle/drivers/api/handler/v2/job.go:1562 +0xd34
github.com/labstack/echo/v4/middleware.JWTWithConfig.func2.1(0x239f980, 0xc001d5b400, 0x1f9ad85, 0xd)
        /universe/src/github.com/actiontech/dtle/vendor/github.com/labstack/echo/v4/middleware/jwt.go:211 +0x3d2
github.com/actiontech/dtle/drivers/api.JWTTokenAdapter.func1.1(0x239f980, 0xc001d5b400, 0x2, 0x2)
        /universe/src/github.com/actiontech/dtle/drivers/api/route.go:157 +0xdc
github.com/labstack/echo/v4.(*Echo).add.func1(0x239f980, 0xc001d5b400, 0x0, 0x0)
        /universe/src/github.com/actiontech/dtle/vendor/github.com/labstack/echo/v4/echo.go:536 +0x62
github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc00005a200, 0x2345480, 0xc001b46620, 0xc001e78f00)
        /universe/src/github.com/actiontech/dtle/vendor/github.com/labstack/echo/v4/echo.go:646 +0x16c
net/http.serverHandler.ServeHTTP(0xc0007948c0, 0x2345480, 0xc001b46620, 0xc001e78f00)
        /opt/go/src/net/http/server.go:2807 +0xa3
net/http.(*conn).serve(0xc001d5b360, 0x234e180, 0xc001e30e00)
        /opt/go/src/net/http/server.go:1895 +0x86c
created by net/http.(*Server).Serve
        /opt/go/src/net/http/server.go:2933 +0x35c: driver=dtle @module=http_api timestamp=2021-08-10T14:37:28.758+0800

Describe the results you received

Describe the results you expected

Output of ./dtle version:**

9.9.9.9-master-e66bf41

Additional information

(e.g. issue happens only occasionally)

Additional details (log, config, job config etc):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions