shmilylty / OneForAll

OneForAll是一款功能强大的子域收集工具

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker版本运行报错SyntaxError: (unicode error)

Z5bra opened this issue · comments

commented

是否使用了最新代码

Bug描述

#运行命令:
docker run -it --rm -v /root/oneforall-docker/results:/OneForAll/results -v /root/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target *打码*.com run
#报错结果
Traceback (most recent call last):
  File "oneforall.py", line 15, in <module>
    import export
  File "/OneForAll/export.py", line 13, in <module>
    from common import utils
  File "/OneForAll/common/utils.py", line 21, in <module>
    from common.database import Database
  File "/OneForAll/common/database.py", line 8, in <module>
    from config.log import logger
  File "/OneForAll/config/log.py", line 27
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte

运行环境

  • 系统:CentOS Linux release 7.9.2009(必写)

暂时不支持输入中文域名

commented

@shmilylty 不是,我那里是手动打个码XD,是正常的域名

@Tardis07 帮忙看一下呢

这个看起来是因为log.py文件里面的特殊字符导致的,如果修改过的话可以检查一下是不是添加了奇怪的字符;或者这个文件是不是用sftp/scp发到windows里面,编辑完没有使用utf-8保存就传回来了。如果没有修改过的话,给我几天时间装一下CentOS看看能不能复现。

commented

@Tardis07 看起来应该是log.py中的特殊字符导致的,我是在github上直接复制的文件到vim中,结果特殊字符应该没有成功复制
image

commented

@Tardis07 @shmilylty 我直接下载config文件后运行,出现了新的报错

[root@root ~]# docker run -it --rm -v ~/oneforall-docker/results:/OneForAll/results -v ~/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target example.com run
Traceback (most recent call last):
  File "oneforall.py", line 15, in <module>
    import export
  File "/OneForAll/export.py", line 13, in <module>
    from common import utils
  File "/OneForAll/common/utils.py", line 21, in <module>
    from common.database import Database
  File "/OneForAll/common/database.py", line 9, in <module>
    from config import settings
ImportError: cannot import name 'settings' from 'config' (unknown location)

目录结构如下:

[root@root oneforall-docker]# tree ./
./
├── config
│   ├── api.py
│   ├── log.py
│   ├── __pycache__
│   │   ├── log.cpython-38.pyc
│   │   └── settings.cpython-38.pyc
│   └── setting.py
├── manual
└── results
    └── oneforall.log

是否使用了最新代码

Bug描述

#运行命令:
docker run -it --rm -v /root/oneforall-docker/results:/OneForAll/results -v /root/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target *打码*.com run
#报错结果
Traceback (most recent call last):
  File "oneforall.py", line 15, in <module>
    import export
  File "/OneForAll/export.py", line 13, in <module>
    from common import utils
  File "/OneForAll/common/utils.py", line 21, in <module>
    from common.database import Database
  File "/OneForAll/common/database.py", line 8, in <module>
    from config.log import logger
  File "/OneForAll/config/log.py", line 27
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte

运行环境

  • 系统:CentOS Linux release 7.9.2009(必写)

已经删除这些特殊字符 5278c2f
可以再测试一下是否还有问题

commented

@shmilylty 我删除了镜像和config文件,重新下载最新的config文件,拉取镜像后,依然报上述新的错误

@Tardis07 @shmilylty 我直接下载config文件后运行,出现了新的报错

[root@root ~]# docker run -it --rm -v ~/oneforall-docker/results:/OneForAll/results -v ~/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target example.com run
Traceback (most recent call last):
  File "oneforall.py", line 15, in <module>
    import export
  File "/OneForAll/export.py", line 13, in <module>
    from common import utils
  File "/OneForAll/common/utils.py", line 21, in <module>
    from common.database import Database
  File "/OneForAll/common/database.py", line 9, in <module>
    from config import settings
ImportError: cannot import name 'settings' from 'config' (unknown location)

目录结构如下:

[root@root oneforall-docker]# tree ./
./
├── config
│   ├── api.py
│   ├── log.py
│   ├── __pycache__
│   │   ├── log.cpython-38.pyc
│   │   └── settings.cpython-38.pyc
│   └── setting.py
├── manual
└── results
    └── oneforall.log
commented

报错如下:

[root@root ~]# docker run -it --rm -v ~/oneforall-docker/results:/OneForAll/results -v ~/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target baidu.com run
Traceback (most recent call last):
  File "oneforall.py", line 15, in <module>
    import export
  File "/OneForAll/export.py", line 13, in <module>
    from common import utils
  File "/OneForAll/common/utils.py", line 21, in <module>
    from common.database import Database
  File "/OneForAll/common/database.py", line 9, in <module>
    from config import settings
ImportError: cannot import name 'settings' from 'config' (unknown location)

目录结构如下:

[root@root oneforall-docker]# tree ./
./
├── config
│   ├── api.py
│   ├── log.py
│   ├── __pycache__
│   │   └── log.cpython-38.pyc
│   └── setting.py
└── results
    └── oneforall.log

3 directories, 5 files

@Tardis07 麻烦奶茶再看看这个问题呢,目前排除了特殊字符的影响了。

@Z5bra config 目录下缺少一个__init__.py文件。顺便发现 README 里面的信息有点陈旧了,稍后我对里面 docker 部署部分的描述进行一下更新

超过一个月没有回复,并且没有其他人复现该问题,默认问题已解决并关闭