ADL LRS saves statement but responds with HTTP 500

281 Views Asked by At

I've installed ADL LRS following README.txt on https://github.com/adlnet/ADL_LRS.

I'm testing it with TincanJS (https://github.com/RusticiSoftware/TinCanJS) with following code, statement gets saved but response code is 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) {
                //...
            }
        }
);

Log at /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

Thanks in advance.

2

There are 2 best solutions below

1
Wolf On

There are log files in the log/ folder created during installation of the LRS. Inside there is an lrs.log file that will tell you what is causing the 500 error. I was able to send statements to a local LRS instance with no 500 error. Please respond back with the error so I can help. Thanks

1
Robert Lowe On

Unless this is just a quirk of TinCanJS, I would think target should be object.