我已经在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
提前致谢。
答案 0 :(得分:0)
在安装LRS期间创建的log/
文件夹中有日志文件。里面有一个lrs.log
文件,它会告诉你导致500错误的原因。我能够将语句发送到本地LRS实例,没有500错误。请回复错误,以便我可以提供帮助。感谢
答案 1 :(得分:0)
除非这只是TinCanJS的一个怪癖,否则我认为target
应为object
。