GloryJin opened a new issue #4458:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/4458


   **Describe the bug**
   User login failed 
   
   **To Reproduce**
   I was build a development environment according to the  "Development 
environment setup" section of  Developer guide, 
   After completing all steps, i start the system . But  the system reports an 
error that the user cannot log in。
   
   **Expected behavior**
   login success with default admin account.
   
   **Screenshots**
   login failed with default admin account.
   
![image](https://user-images.githubusercontent.com/16730864/104584932-49eca880-569e-11eb-9a49-b378346a1d77.png)
   
   
   **Which version of Dolphin Scheduler:**
    -[1.3.4-release]
   
   **Additional context**
   I found the reason through the debugger, The code UpgradeDao.initSchema() 
like this:
   ```
   case POSTGRESQL:
               initSqlPath = "/sql/create/release-1.2.0_schema/postgresql/";
               initSchema(initSqlPath);
               break;
   ```
   then the init sql script dolphinscheduler_ddl.sql like this:
   
![image](https://user-images.githubusercontent.com/16730864/104585032-6be62b00-569e-11eb-8e83-dbdd7ddf8e2c.png)
   
   define the t_ds_user table has not  state field, but the entity User has 
this field as the picture shows. 
   
   
![image](https://user-images.githubusercontent.com/16730864/104584204-2d03a580-569d-11eb-8576-d289a6962bd8.png)
   
   so system throw an error like this when login:
   ```
   ### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: 
Unknown column 'state' in 'field list'
   ### The error may exist in file 
[C:\ericsson\githubpoj\incubator-dolphinscheduler\dolphinscheduler-dao\target\classes\org\apache\dolphinscheduler\dao\mapper\UserMapper.xml]
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: select                  id, user_name, user_password, user_type, 
email, phone, tenant_id, create_time, update_time, queue, state               
from t_ds_user         where user_name=? and user_password = ?
   ### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'state' in 
'field list'
   ; bad SQL grammar []
   ``` 
   
   
   **Requirement or improvement**
   - CreateDolphinScheduler Class  And related init sql script should 
optimization.  According to the different versions, call different sql script。 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to