Coder Social home page Coder Social logo

Comments (7)

Eigh18n avatar Eigh18n commented on August 27, 2024

使用快速启动quickStart.py也遇到了报错

>python quickStart.py Text
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\ADMINI~1\AppData\Local\Temp\jieba.cache
Loading model cost 1.305 seconds.
Prefix dict has been built successfully.
Testing started.
Enter a message and press enter to interact.
amiya
[2021-03-07 12:56:47][group][GID 1061935528][UID 736458622][administrator] amiya
Traceback (most recent call last):
  File "D:\Python18\lib\site-packages\urllib3\connection.py", line 159, in _new_conn
    conn = connection.create_connection(
  File "D:\Python18\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
    raise err
  File "D:\Python18\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
    sock.connect(sa)
OSError: [WinError 10049] 在其上下文中,该请求的地址无效。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Python18\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "D:\Python18\lib\site-packages\urllib3\connectionpool.py", line 392, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "D:\Python18\lib\http\client.py", line 1230, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "D:\Python18\lib\http\client.py", line 1276, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "D:\Python18\lib\http\client.py", line 1225, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "D:\Python18\lib\http\client.py", line 1004, in _send_output
    self.send(msg)
  File "D:\Python18\lib\http\client.py", line 944, in send
    self.connect()
  File "D:\Python18\lib\site-packages\urllib3\connection.py", line 187, in connect
    conn = self._new_conn()
  File "D:\Python18\lib\site-packages\urllib3\connection.py", line 171, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000016D6C5B0880>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Python18\lib\site-packages\requests\adapters.py", line 439, in send
    resp = conn.urlopen(
  File "D:\Python18\lib\site-packages\urllib3\connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "D:\Python18\lib\site-packages\urllib3\util\retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=8080): Max retries exceeded with url: /uploadImage (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000016D6C5B0880>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "quickStart.py", line 46, in <module>
    on_message(message_text, config['admin_id'], config['close_beta']['group_id'])
  File "quickStart.py", line 10, in on_message
    message.on_message({
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\message\messageHandler.py", line 116, in on_message
    result = action['func'](self_data)
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\message\replies\faceImage.py", line 27, in face_image
    return Reply(Image(path), at=False)
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\message\messageType.py", line 42, in __init__
    image_id = imageManager.image(path, 'group')
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\modules\resource\imageManager.py", line 26, in image
    return self.requests_image_id(resource, file_path, image_type)
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\modules\resource\imageManager.py", line 45, in requests_image_id
    response = self.request.post(self.url('uploadImage'), data=multipart_data, headers=headers)
  File "D:\Python18\lib\site-packages\requests\sessions.py", line 578, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "D:\Python18\lib\site-packages\requests\sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "D:\Python18\lib\site-packages\requests\sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "D:\Python18\lib\site-packages\requests\adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=8080): Max retries exceeded with url: /uploadImage (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000016D6C5B0880>: Failed to establish a new connection: [WinError 10049] 在其上下文中,该请求的地址无效。'))

from amiya-bot.

nsc8931 avatar nsc8931 commented on August 27, 2024

是否可以提供一下你的config.json,请删除个人敏感信息

from amiya-bot.

Eigh18n avatar Eigh18n commented on August 27, 2024

mirai-http-api的setting.yml

cors: 
  - '*'
host: 0.0.0.0
port: 8080
authKey: Wmy2005eithteen
cacheSize: 4096
enableWebsocket: false
report: 
  enable: false
  groupMessage: 
    report: true
  friendMessage: 
    report: true
  tempMessage: 
    report: true
  eventMessage: 
    report: true
  destinations: []
  extraHeaders: {}

heartbeat: 
  enable: false
  delay: 1000
  period: 15000
  destinations: []
  extraBody: {}

  extraHeaders: {}

amiya的config.json

{
    "self_id": 123,
    "self_passwords": "***",
    "admin_id": 736458622,
    "mirai_ok": false,
    "auth_key": "Wmy2005eithteen",
    "server": {
        "server_ip": "0.0.0.0",
        "server_port": 8080
    },
    "database": {
        "host": "localhost",
        "port": 3306,
        "user": "root",
        "password": "***",
        "db": "amiya"
    },
    "baidu_cloud": {
        "enable": false,
        "app_id": "",
        "api_key": "",
        "secret_key": ""
    },
    "message": {
        "limit": {
            "seconds": 10,
            "max_count": 3
        },
        "reply_text_max_length": 100
    },
    "close_beta": {
        "enable": false,
        "group_id": 1061935528
    }
}

from amiya-bot.

nsc8931 avatar nsc8931 commented on August 27, 2024

请将amiya的config中"server_ip": "0.0.0.0"字段值更改为127.0.0.10.0.0.0仅能在服务器上使用,表示接受从任何ip地址发送的请求。为了安全起见建议将mirai的监听ip也更改为127.0.0.1127.0.0.1表示本机地址,这样应该可以解决quickstart的问题,请修改后检查python amiya.py是否仍会报错。

from amiya-bot.

Eigh18n avatar Eigh18n commented on August 27, 2024

更改为127.0.0.1后可以连接了,admin账号收到了启动完毕的消息,但是在群聊尝试发送命令时并无反应,控制台有接收消息。
在发送启动完毕消息后,控制台有报错消息,如下

2021-03-07 13:20:29 V/Bot.923594412: Friend(736458622) <- 启动完毕
2021-03-07 13:20:29 E/net.mamoe.mirai-api-http: kotlinx.coroutines.JobCancellationException: StandaloneCoroutine was cancelled; job=StandaloneCoroutine{Cancelling}@1c5ff70
kotlinx.coroutines.JobCancellationException: StandaloneCoroutine was cancelled; job=StandaloneCoroutine{Cancelling}@1c5ff70

2021-03-07 13:20:29 W/stderr: SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
2021-03-07 13:20:29 W/stderr: SLF4J: Defaulting to no-operation MDCAdapter implementation.
2021-03-07 13:20:29 W/stderr: SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.

from amiya-bot.

nsc8931 avatar nsc8931 commented on August 27, 2024

请将miral的setting中enableWebsocket: false的值改为true,本项目实际上是一个websocket客户端

from amiya-bot.

Eigh18n avatar Eigh18n commented on August 27, 2024

成功了。enableWebsocket我改过一次,然后启动后命令行狂刷Server not found. ,于是改了回去。
看来教程又要改一下子了

from amiya-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.