dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Bug][dolphinscheduler-dao] Follow the doc development env setup guide, Cannot log in after the system is started with admin account

Open GloryJin opened this issue 5 years ago • 4 comments

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

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

define the t_ds_user table has not state field, but the entity User has this field as the picture shows.

image

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:\xxx\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。

GloryJin avatar Jan 14 '21 11:01 GloryJin

Hi,Glory,please check the pg table,the t_ds_version table has a record, the version is 1.3.1?

c-f-cooper avatar Jan 15 '21 01:01 c-f-cooper

no, the version is 1.3.4 image

GloryJin avatar Jan 15 '21 02:01 GloryJin

ta-dolphin-scheduler/sql/upgrade/1.3.0_schema/mysql/dolphinscheduler_ddl.sql

image

felix-thinkingdata avatar Jan 15 '21 02:01 felix-thinkingdata

Yeah, so code has no problem, just the guide doc has flaws . After all, according to the document operation, the system can not login in,cause trouble for novice.

there is only this step in the document like this. image

Should add one step, run the main method of org.apache.dolphinscheduler.dao.upgrade.shell.UpgradeDolphinScheduler to automatically update the tables.

GloryJin avatar Jan 15 '21 07:01 GloryJin