Giter Site home page Giter Site logo

vijos / vj4 Goto Github PK

View Code? Open in Web Editor NEW
529.0 25.0 110.0 5.89 MB

The online judge service with millions of submissions, since 2005.

Home Page: https://vijos.org

License: GNU Affero General Public License v3.0

Shell 0.04% Python 43.87% JavaScript 20.19% HTML 24.26% Stylus 11.64%
online-judge python vijos mongodb

vj4's Introduction

vj4

Next generation of Vijos, built with asyncio on Python 3.


Overview

  • Problem Categories and Tags
  • Solution Sharing & Voting
  • Online Coding and Testing (a.k.a. Scratchpad Mode)
  • Discussions & Comments
  • Trainings
  • Contests (ACM & OI)
  • Dynamic Ranking System
  • Real-time Status Updates
  • Online Judge as a Service (a.k.a. Domain): create your own OJ website without dev-ops!
  • Management UI
  • Sandboxed & Distributed Judging: see jd4, winjudge and windows-container
  • Secure (we are also CTF players)
  • Modern Architecture & User Interface

Usage

Pre-built docker package

There is pre-built docker package at vijos/vj4. This is maintained by @moesoha. Source code is available at https://github.com/vijos/vj4-docker.

Manual build

Prerequisites

Install requirements

In the root of the repository, where requirements.txt and package.json locates:

python3 -m pip install -r requirements.txt
yarn

You don't need root privilege to run yarn. It installs stuffs in the project directory. We recommend using Node 10.

You may want to use tuna if you are in China.

Some requirements may need Python.h and ffi.h. In Debian/Ubuntu you can use

apt install python3-dev libffi-dev

to resolve this.

IP Geo-Location

To enable IP geo-location translation, you need to follow the instruction on MaxMind GeoLite2 to obtain a GeoLite2 City Database, unzip it, and put it in the project root directory with the filename GeoLite2-City.mmdb.

You may also want to install libmaxminddb for higher performance.

Development

In the root of the repository:

yarn build   # or: yarn build:watch
python3 -m vj4.server --debug

Set --listen (default: http://127.0.0.1:8888) to listen on a different address.

As an intuitive example, you may want to add a super administrator and a problem to start:

alias pm="python3 -m"
pm vj4.model.user add -1 icebox 12345 [email protected]
pm vj4.model.user set_superadmin -1
pm vj4.model.adaptor.problem add system "Dummy Problem" "# It *works*" -1 1000   # you can also use web UI

You need to run these scripts on a regular basis to maintain correct RP and ranks for all users:

pm vj4.job.rp recalc_all
pm vj4.job.rank run_all

Watch and Restart

Frontend source codes can be recompiled automatically by running:

yarn build:watch

However you need to manually restart the server for server-side code to take effect.

Production

yarn build:production
python3 -m vj4.server --listen=unix:/var/run/vj4.sock
  • Set --listen (default: http://127.0.0.1:8888) to listen on a different address.
  • Set --prefork (default: 1) to specify the number of worker processes.
  • Set --ip-header (default: '') to use IP address in request headers.
  • Set --url-prefix (default: https://vijos.org) to set URL prefix.
  • Set --cdn-prefix (default: /) to set CDN prefix.
  • Set --smtp-host, --smtp-user, --smtp-password, and --mail-from to specify a SMTP server.
  • Set --db-host (default: localhost) and/or --db-name (default: test) to use a different database.

Better to use a reverse proxy like Nginx or h2o.

Judging

To enable vj4 to judge, at least one judge user and one judge daemon instance are needed.

  • Use following commands to create a judge user:
alias pm="python3 -m"
pm vj4.model.user add -2 judge 123456 [email protected]
pm vj4.model.user set_judge -2

Use jd4

Use HydroJudge

Notes

Have fun!

Maximum line width: 100

Indentation: 2 spaces

JavaScript Style Guide

No commercial use, except get permission from us.

References

vj4's People

Contributors

0x3a2b avatar bjrjk avatar blackbbc avatar breezewish avatar dependabot[bot] avatar greenkeeper[bot] avatar iceboy233 avatar joshoy avatar junukwon7 avatar ksyx avatar lukexuan avatar macesuted avatar masnn0 avatar mikumikuchan avatar moesoha avatar moetayuko avatar monkey2000 avatar q234rty avatar samhjn avatar seiarotg avatar sxkdz avatar tc-imba avatar twd2 avatar undefined-moe avatar zsgsdesign avatar zzhou612 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vj4's Issues

Online IDE default code indentation mismatch.

The online IDE has the default example C++ code of:

#include <iostream>

using namespace std;

int main()
{
    return 0;
}

with the indent of 4 spaces.

But the editor would have auto indent of only 2 spaces.

#include <iostream>

using namespace std;

int main()
{
  cout << "hello world" << endl;
    return 0;
}

Suggestions

I'm a common user, and I have poor English. So, please forgive me when I make some mistakes.

First, I think the kinds of contests should be multiple, and we can add the IOI, the CF and so on.
Second, I think we should allow people to change their plan of the contests. Allow them to change the time, the number of the problems and so on.
Third, I think we should add some special kinds of problems, such as the Special Judge, the Answer Handing problem and so on.

The vj4 will be more colorful with our suggestions.

WISH THE VJ4 WILL BE MORE BRILLIANT!

Important! This issues will be updated if I find some suggestions...

Move framework logic into an independent repository

Such as argmethod, options, colored logger and HTTP router. We can improve reusability, interface, performance (lazy option parser, optimize router and HTTP framework), test coverage.

unnamed web framework, inspired by vj4

Corlorful Background

We can make or collect more colorful background to change the head of the websites. That's will be brilliant.

More friendly form

We can add some form validators to make users can correct their illegal inputs before submit.

About the help document

Can we set the domain help document, set the contest information, add some discuss on the main page and so on?
How about give people more power in their own domain in the future?

请教关于设置管理员的问题……

非常感谢,前面npm build的问题处理完了。

但是我不知道如何设置管理员……之前给twd2发了一封邮件,回信中这样说道:

添加管理员,现在只能改数据库。

但是我对mongodb一无所知。从网上找了一点资料,情况是这样:

>use test;
>show users;
(无显示)
> show collections;
document
document.status
domain
record
system
system.indexes
token
user
user.message

请问接下来应该如何操作?

感激不尽

Arguments renamed

The function find() keyword argument fields renamed to projection in PyMongo 3.0, so it doesn't work in the latest version of PyMongo.

Python code unexpectedly running under high memory usage.

Such simple code to solve A + B Problem

a, b = [int(i) for i in raw_input().split()]
print(a + b)

would cost up to 19 to 20M+ of memory usage, causing Memory Excess (Runtime Error).

Within the previous version of vijos, one code would only cost 4-5M of memory.

This should be either compiler's or statistic's problem.

None object is not subscriptable

e.g. https://vijos.org/discuss/5109fdea4e41125014000bb5

Apr  5 14:35:38 vj4 python3.5[385]: #033[31m[E 170405 14:35:38 web_protocol:358]#033[0m Error handling request
Apr  5 14:35:38 vj4 python3.5[385]: Traceback (most recent call last):
Apr  5 14:35:38 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_protocol.py", line 417, in start
Apr  5 14:35:38 vj4 python3.5[385]:     resp = yield from self._request_handler(request)
Apr  5 14:35:38 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web.py", line 289, in _handle
Apr  5 14:35:38 vj4 python3.5[385]:     resp = yield from handler(request)
Apr  5 14:35:38 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 217, in __iter__
Apr  5 14:35:38 vj4 python3.5[385]:     yield from super(Handler, self).__iter__()
Apr  5 14:35:38 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_urldispatcher.py", line 657, in __iter__
Apr  5 14:35:38 vj4 python3.5[385]:     resp = yield from method()
Apr  5 14:35:38 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/discussion.py", line 156, in get
Apr  5 14:35:38 vj4 python3.5[385]:     (vnode['title'], node_url(self, 'discussion_node', discussion.node_id(ddoc))),
Apr  5 14:35:38 vj4 python3.5[385]: TypeError: 'NoneType' object is not subscriptable#033[0m

如何添加题目?

感谢帮助,内网的vijos服务已经搭建了。

现在的问题是,如何添加题目?在Readme.md中有:

pm vj4.controller.problem add system "Dummy Problem" "# It *works*" -1 777

这一段话运行成功了,题库中多了一个“Dummy Problem”。

那么我现在需要解决的事情是:

添加题目:标题、描述、输入输出等。
添加数据。

请问上述问题如何解决?

Can't start

When I use python3.5 -m vj4.server or python3.5 -OO -m vj4.server --listen=unix:/var/run/vj4.sock, it will return some error to me.

[I 160818 21:14:50 server:21] Server listening on http://127.0.0.1:8888
[I 160818 21:14:50 tools:17] Ensuring indexes for "document".
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/vj4/vj4/vj4/server.py", line 50, in <module>
    sys.exit(main())
  File "/home/vj4/vj4/vj4/server.py", line 45, in main
    loop.run_until_complete(loop.create_server(app.Application().make_handler(), sock=sock))
  File "/home/vj4/vj4/vj4/app.py", line 47, in __init__
    self.loop.run_until_complete(asyncio.gather(tools.ensure_all_indexes(), bus.init()))
  File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete
    return future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "/home/vj4/vj4/vj4/service/bus.py", line 15, in init
    channel = await _consume()
  File "/home/vj4/vj4/vj4/service/bus.py", line 20, in _consume
    channel = await mq.channel('bus')
  File "/home/vj4/vj4/vj4/mq.py", line 45, in channel
    channel = await (await _connect()).channel()
  File "/home/vj4/vj4/vj4/mq.py", line 21, in _connect
    virtualhost=options.options.mq_vhost)
  File "/usr/local/lib/python3.5/dist-packages/aioamqp/__init__.py", line 59, in connect
    factory, host, port, **create_connection_kwargs
  File "/usr/lib/python3.5/asyncio/base_events.py", line 695, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.5/asyncio/base_events.py", line 682, in create_connection
    yield from self.sock_connect(sock, address)
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 402, in sock_connect
    return (yield from fut)
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 432, in _sock_connect_cb
    raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 5672)

How to resolve the problem? Thank for your help.

Error seen in log

Apr  5 10:47:29 vj4 python3.5[385]: #033[31m[E 170405 10:47:29 web_protocol:358]#033[0m Error handling request
Apr  5 10:47:29 vj4 python3.5[385]: Traceback (most recent call last):
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 216, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     yield from HandlerBase.prepare(self)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 35, in prepare
Apr  5 10:47:29 vj4 python3.5[385]:     self.session = await self.update_session()
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 126, in update_session
Apr  5 10:47:29 vj4 python3.5[385]:     'update_ua': self.request.headers.get('User-Agent')})
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/model/token.py", line 105, in update
Apr  5 10:47:29 vj4 python3.5[385]:     return_document=ReturnDocument.AFTER)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     yield self  # This tells Task to wait for completion.
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
Apr  5 10:47:29 vj4 python3.5[385]:     future.result()
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/lib/python3.5/asyncio/futures.py", line 266, in result
Apr  5 10:47:29 vj4 python3.5[385]:     raise CancelledError
Apr  5 10:47:29 vj4 python3.5[385]: concurrent.futures._base.CancelledError
Apr  5 10:47:29 vj4 python3.5[385]: During handling of the above exception, another exception occurred:
Apr  5 10:47:29 vj4 python3.5[385]: Traceback (most recent call last):
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_protocol.py", line 417, in start
Apr  5 10:47:29 vj4 python3.5[385]:     resp = yield from self._request_handler(request)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web.py", line 289, in _handle
Apr  5 10:47:29 vj4 python3.5[385]:     resp = yield from handler(request)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 231, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     self.url, self.remote_ip, (self.user and self.user['_id']) or None, repr(e))
Apr  5 10:47:29 vj4 python3.5[385]: AttributeError: 'DiscussionNodeHandler' object has no attribute 'user'#033[0m
Apr  5 10:47:29 vj4 python3.5[385]: #033[31m[E 170405 10:47:29 web_protocol:358]#033[0m Error handling request
Apr  5 10:47:29 vj4 python3.5[385]: Traceback (most recent call last):
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 216, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     yield from HandlerBase.prepare(self)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 35, in prepare
Apr  5 10:47:29 vj4 python3.5[385]:     self.session = await self.update_session()
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 126, in update_session
Apr  5 10:47:29 vj4 python3.5[385]:     'update_ua': self.request.headers.get('User-Agent')})
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/model/token.py", line 105, in update
Apr  5 10:47:29 vj4 python3.5[385]:     return_document=ReturnDocument.AFTER)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     yield self  # This tells Task to wait for completion.
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
Apr  5 10:47:29 vj4 python3.5[385]:     future.result()
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/lib/python3.5/asyncio/futures.py", line 266, in result
Apr  5 10:47:29 vj4 python3.5[385]:     raise CancelledError
Apr  5 10:47:29 vj4 python3.5[385]: concurrent.futures._base.CancelledError
Apr  5 10:47:29 vj4 python3.5[385]: During handling of the above exception, another exception occurred:
Apr  5 10:47:29 vj4 python3.5[385]: Traceback (most recent call last):
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_protocol.py", line 417, in start
Apr  5 10:47:29 vj4 python3.5[385]:     resp = yield from self._request_handler(request)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web.py", line 289, in _handle
Apr  5 10:47:29 vj4 python3.5[385]:     resp = yield from handler(request)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 231, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     self.url, self.remote_ip, (self.user and self.user['_id']) or None, repr(e))
Apr  5 10:47:29 vj4 python3.5[385]: AttributeError: 'ProblemMainHandler' object has no attribute 'user'#033[0m
Apr  5 10:47:29 vj4 python3.5[385]: #033[31m[E 170405 10:47:29 web_protocol:358]#033[0m Error handling request
Apr  5 10:47:29 vj4 python3.5[385]: Traceback (most recent call last):
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 216, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     yield from HandlerBase.prepare(self)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 35, in prepare
Apr  5 10:47:29 vj4 python3.5[385]:     self.session = await self.update_session()
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 126, in update_session
Apr  5 10:47:29 vj4 python3.5[385]:     'update_ua': self.request.headers.get('User-Agent')})
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/model/token.py", line 105, in update
Apr  5 10:47:29 vj4 python3.5[385]:     return_document=ReturnDocument.AFTER)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     yield self  # This tells Task to wait for completion.
Apr  5 10:47:29 vj4 python3.5[385]: concurrent.futures._base.CancelledError
Apr  5 10:47:29 vj4 python3.5[385]: During handling of the above exception, another exception occurred:
Apr  5 10:47:29 vj4 python3.5[385]: Traceback (most recent call last):
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_protocol.py", line 417, in start
Apr  5 10:47:29 vj4 python3.5[385]:     resp = yield from self._request_handler(request)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web.py", line 289, in _handle
Apr  5 10:47:29 vj4 python3.5[385]:     resp = yield from handler(request)
Apr  5 10:47:29 vj4 python3.5[385]:   File "/home/vijos/vj4/vj4/handler/base.py", line 231, in __iter__
Apr  5 10:47:29 vj4 python3.5[385]:     self.url, self.remote_ip, (self.user and self.user['_id']) or None, repr(e))
Apr  5 10:47:29 vj4 python3.5[385]: AttributeError: 'ProblemMainHandler' object has no attribute 'user'#033[0m

Optimize performance

The current bottleneck is on motor. The use of greenlet is extremely slow for unknown reason.

On cpython, domain_read could reach 1000 qps per core without database read, and only 300 qps with database read. On pypy this is even worse - 2000 without database read, and only 100 with database read.

pypy with python 3.5 support is in beta stage. We should prepare to switch to it once it's stable.

There are alternative mongodb asyncio drivers: https://bitbucket.org/mrdon/asyncio-mongo and https://github.com/ZeoAlliance/aiomongo. We could also investigate to switch to another db.

请教npm run build的问题

系统 Ubuntu 15.10
node V4.4.4
RabbitMQ
MongoDB
python3.5

问题开始在npm run build

ERROR in ./pages/judge_playground.page.js

/home/blue/视频/vijos/vj4/ui/pages/judge_playground.page.js
  20:11  error  Parsing error: Unexpected token ..

✖ 1 problem (1 error, 0 warnings)


ERROR in ./components/discussion/comments.page.js

/home/blue/视频/vijos/vj4/ui/components/discussion/comments.page.js
  18:5  error  Parsing error: Unexpected token ..

✖ 1 problem (1 error, 0 warnings)


ERROR in ./components/discussion/CommentBox.js

/home/blue/视频/vijos/vj4/ui/components/discussion/CommentBox.js
  77:7  error  Parsing error: Unexpected token ..

✖ 1 problem (1 error, 0 warnings)


ERROR in ./misc/Util.js

/home/blue/视频/vijos/vj4/ui/misc/Util.js
  4:5  error  Parsing error: Unexpected token ..

✖ 1 problem (1 error, 0 warnings)


ERROR in ./components/DOMAttachedObject.js

/home/blue/视频/vijos/vj4/ui/components/DOMAttachedObject.js
  3:26  error  Parsing error: Unexpected token =

✖ 1 problem (1 error, 0 warnings)


ERROR in ./components/popup/Popup.js

/home/blue/视频/vijos/vj4/ui/components/popup/Popup.js
  6:28  error  Parsing error: Unexpected token =

✖ 1 problem (1 error, 0 warnings)

另外,python3.5 -m vj4.server --debug的时候也出现问题:

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/base_events.py", line 639, in create_connection
    yield from self.sock_connect(sock, address)
  File "/usr/lib/python3.5/asyncio/futures.py", line 385, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 288, in _wakeup
    value = future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 436, in _sock_connect_cb
    raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 5672)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/blue/视频/vijos/vj4/server.py", line 12, in <module>
    web.run_app(app.Application(),
  File "/home/blue/视频/vijos/vj4/app.py", line 40, in __init__
    self.loop.run_until_complete(asyncio.gather(tools.ensure_all_indexes(), bus.init()))
  File "/usr/lib/python3.5/asyncio/base_events.py", line 343, in run_until_complete
    return future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 237, in _step
    result = coro.throw(exc)
  File "/home/blue/视频/vijos/vj4/model/bus.py", line 12, in init
    channel = await _consume()
  File "/home/blue/视频/vijos/vj4/model/bus.py", line 16, in _consume
    channel = await mq.channel('bus')
  File "/home/blue/视频/vijos/vj4/mq.py", line 40, in channel
    channel = await (await _connect()).channel()
  File "/home/blue/视频/vijos/vj4/mq.py", line 18, in _connect
    virtualhost=options.options.mq_vhost)
  File "/home/blue/.local/lib/python3.5/site-packages/aioamqp/__init__.py", line 59, in connect
    factory, host, port, **create_connection_kwargs
  File "/usr/lib/python3.5/asyncio/base_events.py", line 661, in create_connection
    ', '.join(str(exc) for exc in exceptions)))
OSError: Multiple exceptions: [Errno 111] Connect call failed ('::1', 5672, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 5672)

请问如何解决?

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.