learninglocker icon indicating copy to clipboard operation
learninglocker copied to clipboard

/data/xAPI/activities/state gets empty response with stateId specified, the application goes down.

Open drudoi opened this issue 5 years ago • 0 comments

What version were you using?

https://github.com/LearningLocker/xapi-service.git master b068a1e0798a7c3b559e3624e75931a48f07d95d

What steps can we follow to reproduce the behaviour?

  1. Import mongoDB dump with data
  2. Configure storage and keep it empty
  3. Request state in a way: '/data/xAPI/activities/state?activityId=ACTIVITYID&agent=AGENT&registration=REGISTRATION&stateId=STATEID

What is the actual behaviour?

Requesting states for some activity I see:

GET /data/xAPI/activities/state?activityId=******&agent=*****&registration=******

HTTP/1.1 200 OK
["cumulative_time","bookmark","suspend_data"]

Specifying state ID I see:

GET /data/xAPI/activities/state?activityId=******&agent=*****&registration=******&stateId=bookmark

cURL Error (52): Empty reply from server

The same time xapi node app goes down with error in console:

$ node dist/server.js
2020-08-25 16:59:03:534 - info: Listening on port 8081
(node:46567) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
2020-08-25 16:59:03:572 - info: Created new Mongo connection
(node:46567) DeprecationWarning: collection.find option [fields] is deprecated and will be removed in a later version.
2020-08-25 17:02:39:195 - error: uncaughtException: ENOENT: no such file or directory, open '/opt/xapi-service/storage/state/5d67c4c5d7714e081fac6b5b/states/5e41c705a9868b4bbb79151d.bin' 
{ date: 'Tue Aug 25 2020 17:02:39 GMT+0300 (GMT+03:00)',
  process:
   { pid: 46567,
     uid: 1000,
     gid: 1000,
     cwd: '/opt/xapi-service',
     execPath: '/home/******/.nvm/versions/node/v10.22.0/bin/node',
     version: 'v10.22.0',
     argv:
      [ '/home/******/.nvm/versions/node/v10.22.0/bin/node',
        '/opt/xapi-service/dist/server.js' ],
     memoryUsage:
      { rss: 76791808,
        heapTotal: 45563904,
        heapUsed: 39260160,
        external: 18327930 } },
  os:
   { loadavg: [ 0.7080078125, 0.7412109375, 0.77783203125 ],
     uptime: 154959 },
  trace: [],
  stack:
   [ 'Error: ENOENT: no such file or directory, open \'/opt/xapi-service/storage/state/5d67c4c5d7714e081fac6b5b/states/5e41c705a9868b4bbb79151d.bin\'' ] }
2020-08-25 17:02:39:199 - error: Error: ENOENT: no such file or directory, open '/opt/xapi-service/storage/state/5d67c4c5d7714e081fac6b5b/states/5e41c705a9868b4bbb79151d.bin'
2020-08-25 17:02:39:199 - info: uncaughtException
2020-08-25 17:02:39:199 - error: 
2020-08-25 17:02:39:201 - info: exit

$ echo $?
0

What is the expected behavior?

I expect that API respond with some error code and message, the application continue working.

Is there any additional information that will help us replicate/understand the problem?

.env file attached .env.txt

drudoi avatar Aug 25 '20 14:08 drudoi