Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 401 Unauthorized for xAPI response #1627

Closed
ksourabh45 opened this issue Mar 24, 2023 · 28 comments
Closed

Getting 401 Unauthorized for xAPI response #1627

ksourabh45 opened this issue Mar 24, 2023 · 28 comments

Comments

@ksourabh45
Copy link

Hi all,

I have setup learning locker on EC2 instance and trying to insert xAPI statements but getting 401 Unauthorized error.

I have setup store and client as required and also added Basic Authorization header but getting error while trying to insert statements through postman.

Added screenshot below:

image

Please help me in resolving the issue.

Thanks in advance.
Sourabh

@ToranSharma
Copy link

@ksourabh45 have you selected the store in the clients xAPI section?

On Settings -> Clients expand the client you are trying to use and check that your store is selected here (will say LRS (optional) in grey if not):
Screenshot 2023-03-24 at 08 06 49

@ksourabh45
Copy link
Author

Hi @ToranSharma , Thanks for your response.

Yes it has store selected.

image

@looperEit
Copy link

你好@ToranSharma, 感谢您的答复。

是的,它选择了商店。

图像

Hello, may I ask if your installation was successful? Does the Xapi service report no error? What is your system configuration like? After I installed it on my Ubuntu18, the Xapi service could not be started, and I have not been able to find a solution.
image
image

@kichitan
Copy link

kichitan commented Apr 4, 2023

Do you have all in one server or Mongo is running on its own server ?

@ksourabh45
Copy link
Author

Hi all, I was able to fix it. It was due to node libraries version mismatch in xAPI plugin and learning locker.

@ksourabh45
Copy link
Author

Hi @looperEit ,

Have you tried with latest ubuntu?

I have had issues with the same and it works with latest version.

Thanks,
Sourabh

@looperEit
Copy link

您是在一台服务器上拥有所有功能还是在自己的服务器上运行 Mongo?

Yes, I installed all services on one server, including services such as mongoDB and Xapi.
but, I just ran the official wget -qO deployll.sh https://raw.githubusercontent.com/LearningLocker/deploy/master/deployll.sh && bash deployll.sh for automatic installation.

@looperEit
Copy link

你好@looperEit,

您是否尝试过最新的 ubuntu?

我遇到过同样的问题,它适用于最新版本。

谢谢, 苏拉布

hello, thanks for your replying. Did you mean the ubuntu20? but the official recommendation is to use Ubuntu16 or 18. I have tried to use Ubuntu20, but the installation process prompts to use 18, so I use 18 to complete.

@looperEit
Copy link

大家好,我能够修复它。这是由于 xAPI 插件和学习储物柜中的节点库版本不匹配。

Could you please tell me which version I am using? I am using the officially recommended version 14.0 of nodejs.

@looperEit
Copy link

你好@looperEit,

您是否尝试过最新的 ubuntu?

我遇到过类似的问题,它适用于最新版本。

谢谢, 苏拉布

I have been troubled by this problem for a long time, it is very painful. If you can please tell me your configuration and your known solution, thank you. I have tried to install it many times.

@looperEit
Copy link

Do you have all in one server or Mongo is running on its own server ?

hello?

@kichitan
Copy link

kichitan commented Apr 5, 2023

Do you have all in one server or Mongo is running on its own server ?

hello?

I used to, but I decided to go HA, so now the only thing running on my server is nginx and all the LRS roles.

databases are separate, same as statements files and env files.

@looperEit
Copy link

您是在一台服务器上拥有所有功能还是在自己的服务器上运行 Mongo?

你好?

我曾经是,但我决定去 HA,所以现在我的服务器上唯一运行的是 nginx 和所有 LRS 角色。

数据库是分开的,与语句文件和环境文件相同。
Have you ever had such a problem? After I opened http://192.168.103.133/data/xAPI, an error of Faithfully yours, nginx. appeared. But I installed it according to the official deployLL.sh. Do I need to adjust the configuration file during the installation process? May I ask if your mongodb is configured on another server, can it run LL normally? Can the statement be sent to LRS normally?
image
image
image

@ksourabh45
Copy link
Author

Hi @looperEit ,

I had the same error. Please follow below:

First install learning locker using installation script and for xAPI use custom installation because it run on node version greater than >16 and learninglocker service uses node version 10.

  • For this we have to use 2 node versions simultaneously that can be done using node version manager ‘nvm’
  • We have to switch node version every time depends upon which service we want to start

Install both node versions 17.6.0 and 10.24.1 and use 17.6.0 while installing xAPI.

@looperEit
Copy link

thanks for your replying. i will try it.

@looperEit
Copy link

Hi @looperEit ,

I had the same error. Please follow below:

First install learning locker using installation script and for xAPI use custom installation because it run on node version greater than >16 and learninglocker service uses node version 10.

  • For this we have to use 2 node versions simultaneously that can be done using node version manager ‘nvm’
  • We have to switch node version every time depends upon which service we want to start

Install both node versions 17.6.0 and 10.24.1 and use 17.6.0 while installing xAPI.

May I ask, should I start the manual installation directly, or use the script to install learninglocker first, and then use node17 to start the xapi service?

@looperEit
Copy link

你好@looperEit,

我有同样的错误。请按照以下说明:

首先使用安装脚本安装 Learning Locker,对于 xAPI 使用自定义安装,因为它在大于 16 的节点版本上运行,并且 LearningLocker 服务使用节点版本 10。

  • 为此,我们必须同时使用 2 个节点版本,这可以使用节点版本管理器“nvm”来完成
  • 我们每次都必须切换节点版本取决于我们要启动哪个服务

安装节点版本 17.6.0 和 10.24.1,并在安装 xAPI 时使用 17.6.0。

image
目前报了这个错误

@looperEit
Copy link

你好@looperEit,

我有同样的错误。请按照以下说明:

首先使用安装脚本安装 Learning Locker,对于 xAPI 使用自定义安装,因为它在大于 16 的节点版本上运行,并且 LearningLocker 服务使用节点版本 10。

  • 为此,我们必须同时使用 2 个节点版本,这可以使用节点版本管理器“nvm”来完成
  • 我们每次都必须切换节点版本取决于我们要启动哪个服务

安装节点版本 17.6.0 和 10.24.1,并在安装 xAPI 时使用 17.6.0。

If you use node10 to execute the LL installation script, then when you use node17 to install xapi, there will be a problem of inconsistent pm2 versions, and pm2 cannot start all services. How to solve this?

@looperEit
Copy link

Hi @looperEit ,

I had the same error. Please follow below:

First install learning locker using installation script and for xAPI use custom installation because it run on node version greater than >16 and learninglocker service uses node version 10.

  • For this we have to use 2 node versions simultaneously that can be done using node version manager ‘nvm’
  • We have to switch node version every time depends upon which service we want to start

Install both node versions 17.6.0 and 10.24.1 and use 17.6.0 while installing xAPI.

I have used nvm to switch node versions, but the problem now is that if I only have one server, should I switch node10 to install pm2, and then install node17 to install pm2?

@ToranSharma
Copy link

@looperEit,

I think part of the issue is that the deployll.sh script takes the latest version of the xAPI service, which since v7.0.0 does not support node <16. You can pass a flag to the deployll.sh to specify the the version of the xAPI service to use. I think it is the -x flag then pass the version number. So something like -x v6.2.3 should tell the deploy script to use the last v6.x.x version of the xAPI service.

Hopefully this will let you just use a single node version for all processes in pm2. If node 10 worked for you previously try that again. I think this is the default in the deployll.sh script.

@looperEit
Copy link

@looperEit,

我认为部分问题是deployll.sh脚本采用了最新版本的 xAPI 服务,因为 v7.0.0 不支持节点 <16。您可以将标志传递给 以deployll.sh指定要使用的 xAPI 服务的版本。我认为这是-x标志然后传递版本号。所以类似的东西-x v6.2.3应该告诉部署脚本使用 xAPI 服务的最后一个 v6.xx 版本。

希望这会让您只对 pm2 中的所有进程使用单节点版本。如果节点 10 之前为您工作,请再试一次。我认为这是脚本中的默认设置deployll.sh
I have tried to use node10 to start, but the previous problem still occurs, that is, the error sent by postman to http://192.168.103.147/data/xAPI/statements, I have explored all the solutions, I am on 16, I have tried to install LL on both 18 and 20 but failed. When I tried the method mentioned by the partner above, I wanted to use NVM to switch node to 10 to start all services except xAPI, and then switch to node 17 to initialize xAPI, but it failed.
image

@looperEit
Copy link

-x v6.2.3

How to modify this version number?

@ToranSharma
Copy link

This is passed in a the point of running deployll.sh so something like:

./deployll.sh -x v6.2.3

The version number come from the releases pages for the xAPI-Service:
https://github.com/LearningLocker/xapi-service/releases

@looperEit
Copy link

这是在运行点传递的,deployll.sh例如:

./deployll.sh -x v6.2.3

版本号来自 xAPI 服务的发布页面: https://github.com/LearningLocker/xapi-service/releases
Hello, does this problem occur when using build-all?
image

@looperEit
Copy link

这是在运行点传送的,deployll.sh例如:

./deployll.sh -x v6.2.3

版本号来自 xAPI 服务的发布页面: https://github.com/LearningLocker/xapi-service/releases

Hi, I have installed it according to your method. The installation has been completed, and the xapi is running smoothly, but it still cannot be sent. I am thinking whether my use process is wrong?

image
image
image
It's really painful not being able to solve it.

@looperEit
Copy link

as i running the bash test.sh , it shows that
image

@ToranSharma
Copy link

ToranSharma commented Apr 13, 2023

@looperEit

Is the MONGO_URL /usr/local/learninglocker/current/xapi/.env pointing to the correct place for your mongodb server?

EDIT: This now looks to be the state that it was in #1626. Maybe these updates should go in that issue.

@looperEit
Copy link

@looperEit

Is the MONGO_URL /usr/local/learninglocker/current/xapi/.env pointing to the correct place for your mongodb server?

EDIT: This now looks to be the state that it was in #1626. Maybe these updates should go in that issue.

Thank you very much, it is ready to use. I have found a complete solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants