0

我已经按照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

提前致谢。

4

2 回答 2

0

log/在安装 LRS 期间创建的文件夹中有日志文件。里面有一个lrs.log文件会告诉你是什么导致了 500 错误。我能够将语句发送到本地 LRS 实例而没有 500 错误。请回复错误,以便我提供帮助。谢谢

于 2017-03-16T19:55:18.213 回答
0

除非这只是 TinCanJS 的一个怪癖,否则我认为target应该是object.

于 2017-03-17T05:43:20.700 回答