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
用户管理界面添加用户无法成功 #19
Comments
我发现切换到主机管理界面,就会报上面的错,能不能将建表语句修改一下呢? |
@lowenitt 我将上面表结构改为了如下: |
嗯,明白你的意思了,你可以把字段长度设置长一点,比如1024 ,然后发起pull request ,我们鼓励大家和我们一起改进系统和代码 |
@lowenitt 那么,想问一下, 无法添加用户的情况,如何解决呢? |
请更新下代码,如果输入有错误,会提示的 |
尝试更新下版本吧 |
描述:
点击“用户管理”页面,然后再点击“新增用户”,填写好用户信息之后提交,无法成功创建用户,日志如下:
INFO - 2016-12-27 11:35:39 --> Config Class Initialized
INFO - 2016-12-27 11:35:39 --> Hooks Class Initialized
DEBUG - 2016-12-27 11:35:39 --> UTF-8 Support Enabled
INFO - 2016-12-27 11:35:39 --> Utf8 Class Initialized
INFO - 2016-12-27 11:35:39 --> URI Class Initialized
INFO - 2016-12-27 11:35:39 --> Router Class Initialized
INFO - 2016-12-27 11:35:39 --> Output Class Initialized
INFO - 2016-12-27 11:35:39 --> Security Class Initialized
DEBUG - 2016-12-27 11:35:39 --> Global POST, GET and COOKIE data sanitized
INFO - 2016-12-27 11:35:39 --> Input Class Initialized
INFO - 2016-12-27 11:35:39 --> Language Class Initialized
INFO - 2016-12-27 11:35:39 --> Loader Class Initialized
DEBUG - 2016-12-27 11:35:39 --> Config file loaded: /data/htdocs/cc_openSource/application/config/errorcode.php
INFO - 2016-12-27 11:35:39 --> Session: Class initialized using 'files' driver.
DEBUG - 2016-12-27 11:35:39 --> Session class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:35:39 --> Session class already loaded. Second attempt ignored.
INFO - 2016-12-27 11:35:39 --> Controller Class Initialized
INFO - 2016-12-27 11:35:39 --> Parser Class Initialized
INFO - 2016-12-27 11:35:39 --> Language file loaded: language/english/zh_cn_lang.php
DEBUG - 2016-12-27 11:35:39 --> Login class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:35:39 --> Encryption: Auto-configured driver 'openssl'.
INFO - 2016-12-27 11:35:39 --> Encryption: OpenSSL initialized with method AES-128-CBC.
INFO - 2016-12-27 11:35:39 --> Encryption Class Initialized
INFO - 2016-12-27 11:35:39 --> Database Driver Class Initialized
DEBUG - 2016-12-27 11:35:39 --> Login class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:35:39 --> Login class already loaded. Second attempt ignored.
INFO - 2016-12-27 11:35:39 --> File loaded: /data/htdocs/cc_openSource/application/views/account/index.php
INFO - 2016-12-27 11:35:39 --> File loaded: /data/htdocs/cc_openSource/application/views/layout.php
INFO - 2016-12-27 11:35:39 --> Final output sent to browser
DEBUG - 2016-12-27 11:35:39 --> Total execution time: 0.2377
然后点击“主机管理”页面,页面不会报错了,但是日志中有如下错误:
INFO - 2016-12-27 11:37:11 --> Config Class Initialized
INFO - 2016-12-27 11:37:11 --> Hooks Class Initialized
DEBUG - 2016-12-27 11:37:11 --> UTF-8 Support Enabled
INFO - 2016-12-27 11:37:11 --> Utf8 Class Initialized
INFO - 2016-12-27 11:37:11 --> URI Class Initialized
INFO - 2016-12-27 11:37:11 --> Router Class Initialized
INFO - 2016-12-27 11:37:11 --> Output Class Initialized
INFO - 2016-12-27 11:37:11 --> Security Class Initialized
DEBUG - 2016-12-27 11:37:11 --> Global POST, GET and COOKIE data sanitized
INFO - 2016-12-27 11:37:11 --> Input Class Initialized
INFO - 2016-12-27 11:37:11 --> Language Class Initialized
INFO - 2016-12-27 11:37:11 --> Loader Class Initialized
DEBUG - 2016-12-27 11:37:11 --> Config file loaded: /data/htdocs/cc_openSource/application/config/errorcode.php
INFO - 2016-12-27 11:37:11 --> Session: Class initialized using 'files' driver.
DEBUG - 2016-12-27 11:37:11 --> Session class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:37:11 --> Session class already loaded. Second attempt ignored.
INFO - 2016-12-27 11:37:11 --> Controller Class Initialized
INFO - 2016-12-27 11:37:11 --> Parser Class Initialized
INFO - 2016-12-27 11:37:11 --> Language file loaded: language/english/zh_cn_lang.php
DEBUG - 2016-12-27 11:37:11 --> Login class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:37:11 --> Encryption: Auto-configured driver 'openssl'.
INFO - 2016-12-27 11:37:11 --> Encryption: OpenSSL initialized with method AES-128-CBC.
INFO - 2016-12-27 11:37:11 --> Encryption Class Initialized
INFO - 2016-12-27 11:37:11 --> Database Driver Class Initialized
INFO - 2016-12-27 11:37:11 --> File loaded: /data/htdocs/cc_openSource/application/views/host/hostQuery.php
INFO - 2016-12-27 11:37:11 --> File loaded: /data/htdocs/cc_openSource/application/views/layout.php
INFO - 2016-12-27 11:37:11 --> Final output sent to browser
DEBUG - 2016-12-27 11:37:11 --> Total execution time: 0.2681
INFO - 2016-12-27 11:37:11 --> Config Class Initialized
INFO - 2016-12-27 11:37:11 --> Hooks Class Initialized
DEBUG - 2016-12-27 11:37:11 --> UTF-8 Support Enabled
INFO - 2016-12-27 11:37:11 --> Utf8 Class Initialized
INFO - 2016-12-27 11:37:11 --> URI Class Initialized
INFO - 2016-12-27 11:37:11 --> Router Class Initialized
INFO - 2016-12-27 11:37:11 --> Output Class Initialized
INFO - 2016-12-27 11:37:11 --> Security Class Initialized
DEBUG - 2016-12-27 11:37:11 --> Global POST, GET and COOKIE data sanitized
INFO - 2016-12-27 11:37:11 --> Input Class Initialized
INFO - 2016-12-27 11:37:11 --> Language Class Initialized
INFO - 2016-12-27 11:37:11 --> Loader Class Initialized
DEBUG - 2016-12-27 11:37:11 --> Config file loaded: /data/htdocs/cc_openSource/application/config/errorcode.php
INFO - 2016-12-27 11:37:11 --> Session: Class initialized using 'files' driver.
DEBUG - 2016-12-27 11:37:11 --> Session class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:37:11 --> Session class already loaded. Second attempt ignored.
INFO - 2016-12-27 11:37:11 --> Controller Class Initialized
INFO - 2016-12-27 11:37:11 --> Parser Class Initialized
INFO - 2016-12-27 11:37:11 --> Language file loaded: language/english/zh_cn_lang.php
DEBUG - 2016-12-27 11:37:11 --> Login class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:37:11 --> Encryption: Auto-configured driver 'openssl'.
INFO - 2016-12-27 11:37:11 --> Encryption: OpenSSL initialized with method AES-128-CBC.
INFO - 2016-12-27 11:37:11 --> Encryption Class Initialized
INFO - 2016-12-27 11:37:11 --> Database Driver Class Initialized
INFO - 2016-12-27 11:37:11 --> Final output sent to browser
DEBUG - 2016-12-27 11:37:11 --> Total execution time: 0.2273
INFO - 2016-12-27 11:37:12 --> Config Class Initialized
INFO - 2016-12-27 11:37:12 --> Hooks Class Initialized
DEBUG - 2016-12-27 11:37:12 --> UTF-8 Support Enabled
INFO - 2016-12-27 11:37:12 --> Utf8 Class Initialized
INFO - 2016-12-27 11:37:12 --> URI Class Initialized
INFO - 2016-12-27 11:37:12 --> Router Class Initialized
INFO - 2016-12-27 11:37:12 --> Output Class Initialized
INFO - 2016-12-27 11:37:12 --> Security Class Initialized
DEBUG - 2016-12-27 11:37:12 --> Global POST, GET and COOKIE data sanitized
INFO - 2016-12-27 11:37:12 --> Input Class Initialized
INFO - 2016-12-27 11:37:12 --> Language Class Initialized
INFO - 2016-12-27 11:37:12 --> Loader Class Initialized
DEBUG - 2016-12-27 11:37:12 --> Config file loaded: /data/htdocs/cc_openSource/application/config/errorcode.php
INFO - 2016-12-27 11:37:12 --> Session: Class initialized using 'files' driver.
DEBUG - 2016-12-27 11:37:12 --> Session class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:37:12 --> Session class already loaded. Second attempt ignored.
INFO - 2016-12-27 11:37:12 --> Controller Class Initialized
INFO - 2016-12-27 11:37:12 --> Parser Class Initialized
INFO - 2016-12-27 11:37:12 --> Language file loaded: language/english/zh_cn_lang.php
DEBUG - 2016-12-27 11:37:12 --> Login class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:37:12 --> Encryption: Auto-configured driver 'openssl'.
INFO - 2016-12-27 11:37:12 --> Encryption: OpenSSL initialized with method AES-128-CBC.
INFO - 2016-12-27 11:37:12 --> Encryption Class Initialized
INFO - 2016-12-27 11:37:12 --> Database Driver Class Initialized
INFO - 2016-12-27 11:37:12 --> Final output sent to browser
DEBUG - 2016-12-27 11:37:12 --> Total execution time: 0.1176
INFO - 2016-12-27 11:37:12 --> Config Class Initialized
INFO - 2016-12-27 11:37:12 --> Hooks Class Initialized
DEBUG - 2016-12-27 11:37:12 --> UTF-8 Support Enabled
INFO - 2016-12-27 11:37:12 --> Utf8 Class Initialized
INFO - 2016-12-27 11:37:12 --> URI Class Initialized
INFO - 2016-12-27 11:37:12 --> Router Class Initialized
INFO - 2016-12-27 11:37:12 --> Output Class Initialized
INFO - 2016-12-27 11:37:12 --> Security Class Initialized
DEBUG - 2016-12-27 11:37:12 --> Global POST, GET and COOKIE data sanitized
INFO - 2016-12-27 11:37:12 --> Input Class Initialized
INFO - 2016-12-27 11:37:12 --> Language Class Initialized
INFO - 2016-12-27 11:37:12 --> Loader Class Initialized
DEBUG - 2016-12-27 11:37:12 --> Config file loaded: /data/htdocs/cc_openSource/application/config/errorcode.php
INFO - 2016-12-27 11:37:12 --> Session: Class initialized using 'files' driver.
DEBUG - 2016-12-27 11:37:12 --> Session class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:37:12 --> Session class already loaded. Second attempt ignored.
INFO - 2016-12-27 11:37:12 --> Controller Class Initialized
INFO - 2016-12-27 11:37:12 --> Parser Class Initialized
INFO - 2016-12-27 11:37:12 --> Language file loaded: language/english/zh_cn_lang.php
DEBUG - 2016-12-27 11:37:12 --> Login class already loaded. Second attempt ignored.
DEBUG - 2016-12-27 11:37:12 --> Encryption: Auto-configured driver 'openssl'.
INFO - 2016-12-27 11:37:12 --> Encryption: OpenSSL initialized with method AES-128-CBC.
INFO - 2016-12-27 11:37:12 --> Encryption Class Initialized
INFO - 2016-12-27 11:37:12 --> Database Driver Class Initialized
ERROR - 2016-12-27 11:37:12 --> Query error: Field 'DefaultCon' doesn't have a default value - Invalid query: INSERT INTO
cc_UserCustom
(DefaultColumn
,UserName
) VALUES ('["InnerIP","OuterIP","SetName","ModuleName","HostName"]', 'admin')ERROR - 2016-12-27 11:37:12 --> [上海] [admin] [10.0.90.8] 添加用户定制, 失败!mysql_errno: 1364, mysql_error: Field 'DefaultCon' doesn't have a default value
INFO - 2016-12-27 11:37:12 --> Final output sent to browser
DEBUG - 2016-12-27 11:37:12 --> Total execution time: 0.1128
之前的导入最新的bk-cmdb.sql 无报错,执行 php index.php /cli/Init/initUserData都没有报错。然后我手动修改报错表的字段,提示错误:
mysql> alter table cc_UserCustom modify column
DefaultCon
text NOT NULL default '' COMMENT '主机查询条件';ERROR 1101 (42000): BLOB/TEXT column 'DefaultCon' can't have a default value
不知道是什么问题,请指导
The text was updated successfully, but these errors were encountered: