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

Bug: Complex Passwords with Special Characters Cause Configuration Parsing Errors [error] failed to initialize database, got error Error 1045 (2800): Access denied for user 'root'e'172.28.0.1' (using password: yES (using password: YES) #1320

Closed
cubxxw opened this issue Nov 2, 2023 · 2 comments
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@cubxxw
Copy link
Contributor

cubxxw commented Nov 2, 2023

What happened?

When setting a complex password with special characters via environment variables, the configuration parser seems to escape these characters. This might lead to issues if the application reading the configuration doesn't handle escaped characters properly.

What did you expect to happen?

Set a password with special characters as an environment variable

export PASSWORD="jsa23*&*."
make init 

Observe the diff:

object:
   enable: "minio"
   apiURL: "http://43.134.63.160:10002"
   minio:
     bucket: "openim"
     endpoint: "http://172.28.0.1:10005"
     accessKeyID: "root"
     secretAccessKey: "jsa23\*\&\*."
     sessionToken: ''

Special characters in the password are escaped in the configuration file, leading to possible misinterpretations by applications that use this config.

How can we reproduce it (as minimally and precisely as possible)?

The password in the configuration file should exactly match the one set in the environment variable, without additional escaping.

Anything else we need to know?

Modify the configuration parser to handle special characters in passwords without escaping them.

Update the environment configuration documentation to provide guidelines or limitations on using special characters in passwords.

Using a password without special characters or with a limited set of special characters that don't require escaping works as a temporary workaround.

version

```console root@VM-0-9-ubuntu:/home/ubuntu/open-im-server# make version Post-start actions for OpenIM Tools... Starting infra... Starting PATH: /home/ubuntu/open-im-server/_output/bin/tools/linux/amd64/infra... Starting infra... 2023/11/02 08:55:44 Current module is still under development.

Current module is still under development.


/ __ \ |_ || / |
| | | | _ __ ___ _ __ | | | \ / |
| | | || '
\ / _ | '_ \ | | | |/| |
| || || |) || /| | | | | | | | | |
_
/ | .
/ _||| |||___||| ||
| |
|_|

Keep checking for updates!

Starting versionchecker...
Starting PATH: /home/ubuntu/open-im-server/_output/bin/tools/linux/amd64/versionchecker...
Starting versionchecker...
Current Date & Time:%!(EXTRA string=2023-11-02 08:55:44)

Diagnostic Tool Result

Go Version

Go Version: go1.19.3
OS: linux
Architecture: amd64

Branch Type

main

Docker Version

Docker version 20.10.24, build 297e128

Docker Compose Version

Docker Compose version v2.17.2

Kubernetes Version

Kubernetes is not installed. Please install it to get the version.

OpenIM Versions

OpenIM Server: v3.2
OpenIM Client: v3.2

</details>


### Cloud provider

<details>
</details>


### OS version

<details>
```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

@cubxxw cubxxw added the bug Categorizes issue or PR as related to a bug. label Nov 2, 2023
@kubbot
Copy link
Contributor

kubbot commented Jan 1, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@kubbot
Copy link
Contributor

kubbot commented Jan 10, 2024

This issue was closed because it has been stalled for 7 days with no activity.

@kubbot kubbot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2024
@cubxxw cubxxw closed this as completed Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants