amazingTest / Taisite-Platform

最强接口测试平台
GNU Affero General Public License v3.0
286 stars 135 forks source link

sh deploy 时报错 #20

Closed zhouweisong closed 3 years ago

zhouweisong commented 3 years ago

/etc/profile 配置如下

export AUTOTEST_PLATFORM_ENV=production export AUTOTEST_PLATFORM_NLP_SERVER_HOST=127.0.0.1 export AUTOTEST_PLATFORM_MONGO_HOST=172.17.0.3 export AUTOTEST_PLATFORM_MONGO_PORT= 27017 export AUTOTEST_PLATFORM_MONGO_USERNAME=zhouweisong export AUTOTEST_PLATFORM_MONGO_PASSWORD=cuiying1205 export AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME=taisite

执行 sh deploy 8090 时报错如下 Traceback (most recent call last): File "createAdminUser.py", line 10, in port=int(config.get_mongo_port()), ValueError: invalid literal for int() with base 10: '' Traceback (most recent call last): File "run.py", line 2, in from app import app File "/app/AutoTest-Platform/backend/app/init.py", line 26, in port=init(_config.get_mongo_port()), NameError: name 'init' is not defined

请大佬帮忙看下

zhouweisong commented 3 years ago

[root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite

应该是mongo port 配的有问题,应该咋配呢?

amazingTest commented 3 years ago

你是不是自己改错了,把26行的 init 改成 int

------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 上午10:42 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20)

/etc/profile 配置如下

export AUTOTEST_PLATFORM_ENV=production export AUTOTEST_PLATFORM_NLP_SERVER_HOST=127.0.0.1 export AUTOTEST_PLATFORM_MONGO_HOST=172.17.0.3 export AUTOTEST_PLATFORM_MONGO_PORT= 27017 export AUTOTEST_PLATFORM_MONGO_USERNAME=zhouweisong export AUTOTEST_PLATFORM_MONGO_PASSWORD=cuiying1205 export AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME=taisite

执行 sh deploy 8090 时报错如下 Traceback (most recent call last): File "createAdminUser.py", line 10, in port=int(config.get_mongo_port()), ValueError: invalid literal for int() with base 10: '' Traceback (most recent call last): File "run.py", line 2, in from app import app File "/app/AutoTest-Platform/backend/app/init.py", line 26, in port=init(_config.get_mongo_port()), NameError: name 'init' is not defined

请大佬帮忙看下

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zhouweisong commented 3 years ago

没有改,代码如下: conn, db = connect(_config.get_mongo_default_db_name(), ip=_config.get_mongo_host(), port=init(_config.get_mongo_port()), username=_config.get_mongo_username(), password=_config.get_mongo_password())

应该不是代码问题,是那个配置文件的问题,猜测如下 [root@cyxbw_3 Taisite-Platform]# source /etc/profile -bash: export: `27017': 不是有效的标识符

我执行如下命令时,获取不到端口号 [root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite AUTOTEST_PLATFORM_SECRET_KEY: ----------> ���K��4� � �那�w��~�J

zhouweisong commented 3 years ago

你是不是自己改错了,把26行的 init 改成 int ------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 上午10:42 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20) /etc/profile 配置如下 export AUTOTEST_PLATFORM_ENV=production export AUTOTEST_PLATFORM_NLP_SERVER_HOST=127.0.0.1 export AUTOTEST_PLATFORM_MONGO_HOST=172.17.0.3 export AUTOTEST_PLATFORM_MONGO_PORT= 27017 export AUTOTEST_PLATFORM_MONGO_USERNAME=zhouweisong export AUTOTEST_PLATFORM_MONGO_PASSWORD=cuiying1205 export AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME=taisite 执行 sh deploy 8090 时报错如下 Traceback (most recent call last): File "createAdminUser.py", line 10, in port=int(config.get_mongo_port()), ValueError: invalid literal for int() with base 10: '' Traceback (most recent call last): File "run.py", line 2, in from app import app File "/app/AutoTest-Platform/backend/app/init.py", line 26, in port=init(_config.get_mongo_port()), NameError: name 'init' is not defined 请大佬帮忙看下 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

我刚才又看了下源码26行 port=int(_config.get_mongo_port()),

确实应该是 int,我改回 int 还是不行

amazingTest commented 3 years ago

port=init(_config.get_mongo_port()),

这一行有问题

改成: port=int(_config.get_mongo_port()),

------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 中午11:16 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "523314409"<523314409@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20)

没有改,代码如下: conn, db = connect(_config.get_mongo_default_db_name(), ip=_config.get_mongo_host(), port=init(_config.get_mongo_port()), username=_config.get_mongo_username(), password=_config.get_mongo_password())

应该不是代码问题,是那个配置文件的问题,猜测如下 [root@cyxbw_3 Taisite-Platform]# source /etc/profile -bash: export: `27017': 不是有效的标识符

我执行如下命令时,获取不到端口号 [root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite AUTOTEST_PLATFORM_SECRET_KEY: ----------> ���K��4� � �那�w��~�J

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

zhouweisong commented 3 years ago

port=init(_config.get_mongo_port()), 这一行有问题 改成: port=int(_config.get_mongo_port()), ------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 中午11:16 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "523314409"<523314409@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20) 没有改,代码如下: conn, db = connect(_config.get_mongo_default_db_name(), ip=_config.get_mongo_host(), port=init(_config.get_mongo_port()), username=_config.get_mongo_username(), password=_config.get_mongo_password()) 应该不是代码问题,是那个配置文件的问题,猜测如下 [root@cyxbw_3 Taisite-Platform]# source /etc/profile -bash: export: `27017': 不是有效的标识符 我执行如下命令时,获取不到端口号 [root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite AUTOTEST_PLATFORM_SECRET_KEY: ----------> ���K��4� � �那�w��~�J — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

修改后还是不行 Traceback (most recent call last): File "createAdminUser.py", line 10, in port=int(config.get_mongo_port()), ValueError: invalid literal for int() with base 10: '' Traceback (most recent call last): File "run.py", line 2, in from app import app File "/app/AutoTest-Platform/backend/app/init.py", line 26, in port=int(_config.get_mongo_port()), ValueError: invalid literal for int() with base 10: ''

amazingTest commented 3 years ago

这个是环境变量没配置好,检查一下

------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 中午11:25 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "523314409"<523314409@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20)

port=init(_config.get_mongo_port()), 这一行有问题 改成: port=int(_config.get_mongo_port()), … ------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 中午11:16 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "523314409"<523314409@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20) 没有改,代码如下: conn, db = connect(_config.get_mongo_default_db_name(), ip=_config.get_mongo_host(), port=init(_config.get_mongo_port()), username=_config.get_mongo_username(), password=_config.get_mongo_password()) 应该不是代码问题,是那个配置文件的问题,猜测如下 [root@cyxbw_3 Taisite-Platform]# source /etc/profile -bash: export: `27017': 不是有效的标识符 我执行如下命令时,获取不到端口号 [root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite AUTOTEST_PLATFORM_SECRET_KEY: ----------> ���K��4� � �那�w��~�J — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

修改后还是不行 Traceback (most recent call last): File "createAdminUser.py", line 10, in port=int(config.get_mongo_port()), ValueError: invalid literal for int() with base 10: '' Traceback (most recent call last): File "run.py", line 2, in from app import app File "/app/AutoTest-Platform/backend/app/init.py", line 26, in port=int(_config.get_mongo_port()), ValueError: invalid literal for int() with base 10: ''

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

zhouweisong commented 3 years ago

[root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite AUTOTEST_PLATFORM_SECRET_KEY: ----------> ���K��4� � �那�w��~�J

问题应该是 获取不到端口号,配置文件 我填的端口号是 27017 这个应该没问题吧?

amazingTest commented 3 years ago

这个端口变量没配置好,其他是ok的

------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 中午11:27 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "523314409"<523314409@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20)

[root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite AUTOTEST_PLATFORM_SECRET_KEY: ----------> ���K��4� � �那�w��~�J

问题应该是 获取不到端口号,配置文件 我填的端口号是 27017 这个应该没问题吧?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

zhouweisong commented 3 years ago

这个端口变量没配置好,其他是ok的 ------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 中午11:27 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "523314409"<523314409@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20) [root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite AUTOTEST_PLATFORM_SECRET_KEY: ----------> ���K��4� � �那�w��~�J 问题应该是 获取不到端口号,配置文件 我填的端口号是 27017 这个应该没问题吧? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

找到原因了,端口号前面多了个空格...... 多谢帮忙

amazingTest commented 3 years ago

嗯嗯,感谢使用,祝使用愉快

------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 中午11:30 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "523314409"<523314409@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20)

这个端口变量没配置好,其他是ok的 … ------------------ 原始邮件 ------------------ 发件人: "amazingTest/Taisite-Platform" <notifications@github.com>; 发送时间: 2021年1月13日(星期三) 中午11:27 收件人: "amazingTest/Taisite-Platform"<Taisite-Platform@noreply.github.com>; 抄送: "523314409"<523314409@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [amazingTest/Taisite-Platform] sh deploy 时报错 (#20) [root@cyxbw_3 Taisite-Platform]# python ./backend/config.py AUTOTEST_PLATFORM_ENV: ----------> production AUTOTEST_PLATFORM_MONGO_HOST: ----------> 172.17.0.3 AUTOTEST_PLATFORM_MONGO_PORT: ----------> AUTOTEST_PLATFORM_NLP_SERVER_HOST: ----------> 127.0.0.2 AUTOTEST_PLATFORM_MONGO_USERNAME: ----------> zhouweisong AUTOTEST_PLATFORM_MONGO_PASSWORD: ----------> cuiying1205 AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME: ----------> taisite AUTOTEST_PLATFORM_SECRET_KEY: ----------> ���K��4� � �那�w��~�J 问题应该是 获取不到端口号,配置文件 我填的端口号是 27017 这个应该没问题吧? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

找到原因了,端口号前面多了个空格...... 多谢帮忙

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.