# Common ERROR

## 1. Using MySQL database, 500 Internal Server Error occurs

Error messages similar to the following:

* populate() isn't reentrant
* MySQLdb.\_exceptions.OperationalError: (2059, NULL)

### Solution:

Since Django currently does not support the cache\_sha2\_password encryption method of mysql8.0, it needs to be modified to the mysql\_native\_password encryption method.

Open the mysql command window and enter the command

```
ALTER USER '<account>'@'localhost' IDENTIFIED BY '<account>' PASSWORD EXPIRE NEVER;
```

Update password

```
ALTER USER '<account>'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';
```

Restart the service after modification

<figure><img src="https://github.com/syscom-go/omflow-gitbook/blob/english/.gitbook/assets/OMFLOW%20Architecture%20(2).png" alt=""><figcaption></figcaption></figure>

## 2. When using SQL Server database, error.log appears during the installation or update process.

Looking at error.log, the following similar error message appears:

\*SQL Server v16 is not supported.

* raise FullResultSet

### Solution:

Since django4.2 and SQL Server 2022, the original mssql related package is no longer supported. Please follow the steps below:

#### Download Kit

Please go to the Python folder to install the required packages:

For the Windows version, the path is `C:\Program Files\OMFLOW Server\Python`

```
python.exe -m pip install mssql-django -t Lib\site-packages

```

The Linux version enters the virtual Python environment

```
pip install mssql-django

```

#### Modify settings.py

The Windows version path is `C:\Program Files\OMFLOW Server\omflow\omflow\settings.py`

The Linux version path is `/opt/omflow/server/omflow/settings.py`

```
#Change the ENGINE parameter value to mssql
DATABASES = {"default": {"ENGINE": "sql_server.pyodbc","NAME":...The following will be omitted
#Change to
DATABASES = {"default": {"ENGINE": "mssql","NAME":......The following will be omitted
```

#### Re-execute the update file

## 3. Use Domain or external IP connection to return CSRF (403) error - 1.2.1 New

### Solution:

After Django 4.2 version, using Domain for connection requires additional setting of **CSRF\_TRUSTED\_ORIGINS** parameter.

#### Modify settings.py

The Windows version path is `C:\Program Files\OMFLOW Server\omflow\omflow\settings.py`

The Linux version path is `/opt/omflow/server/omflow/settings.py`

```
DEBUG = False

#Add the following settings and replace the URL with the Domain used
CSRF_TRUSTED_ORIGINS = [
        'https://*.example1.com',
        'https://*.example2.com',
        ...
    ]
```

#### Re-execute the update file


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.omflow.com.tw/english/id-2/2-13-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
