我已经在https://github.com/adlnet/ADL_LRS上安装了跟随README.txt的ADL LRS。
我正在用TincanJS (https://github.com/RusticiSoftware/TinCanJS)用以下代码测试它,语句被保存,但响应代码是500。
lrs = new TinCan.LRS(
{
////// This works well
endpoint: "https://cloud.scorm.com/tc/public/",
username: "<Test User>",
password: "<Test Password>",
allowFail: false
////// This returns Internal Error(500)
endpoint: "my.server:8000/xapi/",
username: "<My User>",
password: "<My Password>",
allowFail: false
}
);
var statement = new TinCan.Statement(
{
actor: {
"name": "Ac Tor",
"account": {
"homePage": "http://act.or",
"name": "actor"
}
},
verb: {
id: "http://adlnet.gov/expapi/verbs/experienced"
},
target: {
id: "http://rusticisoftware.github.com/TinCanJS"
}
}
);
lrs.saveStatement(
statement,
{
callback: function (err, xhr) {
//...
}
}
);日志地址为/ADL_LRS/../logs/lrs.log:
2017-03-15 10:33:31,248 [ERROR] lrs.views: 500 === /xapi/statements
Traceback (most recent call last):
File "/home/kursat/ADL_LRS/lrs/views.py", line 214, in handle_request
return processors[path][req_dict['method']](req_dict)
File "/home/kursat/ADL_LRS/lrs/utils/req_process.py", line 164, in statements_put
check_activity_metadata.delay(stmt_ids)
File "/home/kursat/env/local/lib/python2.7/site-packages/celery/app/task.py", line 453, in delay
return self.apply_async(args, kwargs)
File "/home/kursat/env/local/lib/python2.7/site-packages/celery/app/task.py", line 560, in apply_async
**dict(self._get_exec_options(), **options)
File "/home/kursat/env/local/lib/python2.7/site-packages/celery/app/base.py", line 354, in send_task
reply_to=reply_to or self.oid, **options
File "/home/kursat/env/local/lib/python2.7/site-packages/celery/app/amqp.py", line 305, in publish_task
**kwargs
File "/home/kursat/env/local/lib/python2.7/site-packages/kombu/messaging.py", line 172, in publish
routing_key, mandatory, immediate, exchange, declare)
File "/home/kursat/env/local/lib/python2.7/site-packages/kombu/connection.py", line 470, in _ensured
interval_max)
File "/home/kursat/env/local/lib/python2.7/site-packages/kombu/connection.py", line 382, in ensure_connection
interval_start, interval_step, interval_max, callback)
File "/home/kursat/env/local/lib/python2.7/site-packages/kombu/utils/__init__.py", line 246, in retry_over_time
return fun(*args, **kwargs)
File "/home/kursat/env/local/lib/python2.7/site-packages/kombu/connection.py", line 250, in connect
return self.connection
File "/home/kursat/env/local/lib/python2.7/site-packages/kombu/connection.py", line 756, in connection
self._connection = self._establish_connection()
File "/home/kursat/env/local/lib/python2.7/site-packages/kombu/connection.py", line 711, in _establish_connection
conn = self.transport.establish_connection()
File "/home/kursat/env/local/lib/python2.7/site-packages/kombu/transport/pyamqp.py", line 116, in establish_connection
conn = self.Connection(**opts)
File "/home/kursat/env/local/lib/python2.7/site-packages/amqp/connection.py", line 183, in __init__
return self._x_open(virtual_host)
File "/home/kursat/env/local/lib/python2.7/site-packages/amqp/connection.py", line 628, in _x_open
(10, 41), # Connection.open_ok
File "/home/kursat/env/local/lib/python2.7/site-packages/amqp/abstract_channel.py", line 67, in wait
self.channel_id, allowed_methods, timeout)
File "/home/kursat/env/local/lib/python2.7/site-packages/amqp/connection.py", line 241, in _wait_method
channel, method_sig, args, content = read_timeout(timeout)
File "/home/kursat/env/local/lib/python2.7/site-packages/amqp/connection.py", line 330, in read_timeout
return self.method_reader.read_method()
File "/home/kursat/env/local/lib/python2.7/site-packages/amqp/method_framing.py", line 189, in read_method
raise m
error: [Errno 104] Connection reset by peer提前谢谢。
发布于 2017-03-17 03:55:18
log/文件夹中有一些日志文件,这些文件是在安装LRS期间创建的。里面有一个lrs.log文件,它将告诉你是什么导致了500错误。我能够将语句发送到本地LRS实例,没有出现500错误。请回复错误,以便我可以提供帮助。谢谢
发布于 2017-03-17 13:43:21
除非这只是TinCanJS的怪癖,否则我认为target应该是object。
https://stackoverflow.com/questions/42827264
复制相似问题