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

Automate setup of LRS, store valid credentials in config.ini #8

Closed
usernamenumber opened this issue May 12, 2015 · 23 comments
Closed

Comments

@usernamenumber
Copy link
Contributor

_Update:_ This issue was initially created for what turned out to be a symptom of incomplete configuration. The issue has been re-purposed to track automating those configuration tasks.


My guess is that we have the wrong credentials in swagportal's config.ini, but I don't have time to troubleshoot now, so here's what's going on:

When I try to load the example swagmap it hangs, while the JS console gets 64 messages like this:

Failed to load resource: the server responded with a status of 401 (Unauthorized)
swagmap.min.js:9 Uncaught TypeError: Cannot read property 'length' of undefined
http://learninglocker.dev.swag.tunapanda.org/data/xAPI/statements?agent=%7B…D&activity=http%3A%2F%2Fktouch.tunapanda.org%2FTunapandaEn.ktouch.xml%2314 

Following that url returns the following JSON:

{"error":true,"success":false,"message":"Unauthorized request.","code":401,"trace":[{"function":"{closure}","args":[{},{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Events\/Dispatcher.php","line":199,"function":"call_user_func_array","args":[{},[{},{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Events\/Dispatcher.php","line":154,"function":"fire","class":"Illuminate\\Events\\Dispatcher","type":"->","args":["router.filter: auth.statement",[{},{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}],true]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php","line":1470,"function":"until","class":"Illuminate\\Events\\Dispatcher","type":"->","args":["router.filter: auth.statement",[{},{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php","line":1432,"function":"callRouteFilter","class":"Illuminate\\Routing\\Router","type":"->","args":["auth.statement",[],{},{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php","line":1319,"function":"callAttachedBefores","class":"Illuminate\\Routing\\Router","type":"->","args":[{},{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php","line":1024,"function":"callRouteBefore","class":"Illuminate\\Routing\\Router","type":"->","args":[{},{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php","line":996,"function":"dispatchToRoute","class":"Illuminate\\Routing\\Router","type":"->","args":[{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php","line":776,"function":"dispatch","class":"Illuminate\\Routing\\Router","type":"->","args":[{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php","line":746,"function":"dispatch","class":"Illuminate\\Foundation\\Application","type":"->","args":[{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Session\/Middleware.php","line":72,"function":"handle","class":"Illuminate\\Foundation\\Application","type":"->","args":[{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}},1,true]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Cookie\/Queue.php","line":47,"function":"handle","class":"Illuminate\\Session\\Middleware","type":"->","args":[{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}},1,true]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Cookie\/Guard.php","line":51,"function":"handle","class":"Illuminate\\Cookie\\Queue","type":"->","args":[{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}},1,true]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/stack\/builder\/src\/Stack\/StackedHttpKernel.php","line":23,"function":"handle","class":"Illuminate\\Cookie\\Guard","type":"->","args":[{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}},1,true]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php","line":642,"function":"handle","class":"Stack\\StackedHttpKernel","type":"->","args":[{"attributes":{},"request":{},"query":{},"server":{},"files":{},"cookies":{},"headers":{}}]},{"file":"\/usr\/local\/tunapanda\/provision\/modules\/learninglocker\/public\/index.php","line":49,"function":"run","class":"Illuminate\\Foundation\\Application","type":"->","args":[]}]}
@limikael
Copy link
Contributor

Yes,

The credentials in the config.ini must be synced with those of the Learning Locker LRS.

There should also be better error reporting in the swagmapviewer, but there is already another issue for that.

@usernamenumber
Copy link
Contributor Author

Hrmm... the provisioning system should put appropriate values in there. I can look into it, but not until at least tomorrow, most likely. Too much stuff I have to prioritize at work for today. :(

@usernamenumber
Copy link
Contributor Author

...oh, of course, those vars are just using default values right now. We won't be able to put real values in until we've automated setting up an LRS in LL.

@usernamenumber
Copy link
Contributor Author

Ok, I took the time to create an LRS and put proper credentials into config.ini and now it works! I'll re-title this issue to deal with automating the setup.

@usernamenumber usernamenumber changed the title bunch of 401 errors loading swagmap Automate setup of LRS, store valid credentials in config.ini May 12, 2015
@limikael
Copy link
Contributor

So currently we are populating MongoDB with data that we thing should be
an LRS, but learninglocker doesn't recognize it because it probably puts
some data somewhere else as well?

In that case I can look into it...
On 12 May 2015 21:33, "Brad Smith" [email protected] wrote:

...oh, of course, those vars are just using default values right now. We
won't be able to put real values in until we've automated setting up an LRS
in LL.


Reply to this email directly or view it on GitHub
tunapanda/wikonnect#8 (comment).

@usernamenumber
Copy link
Contributor Author

Here's something to start with: I made a list of the files in the LL dir and in /var before and after creating the LRS. It looks like it does do something to mongo, but I've found no evidence of the LRS data actually going there, so it might be some other incidental thing. Those app/storage/cache/... files look much more interesting to me.

Good hunting! ;)

285a286,288
> modules/learninglocker/app/storage/cache/3b
> modules/learninglocker/app/storage/cache/3b/02
> modules/learninglocker/app/storage/cache/3b/02/3b0216f6bc968b9c52948270acd59fc0
10663a10667
> /var/lib/mongodb/_tmp

@usernamenumber
Copy link
Contributor Author

...actually, now there is an lrs collection in Mongo, so I may have been wrong. Unfortunately it's empty, and as I understand it in Mongo that means we can't even tell what the schema (inasmuch as Mongo has schemas) is, so it looks like you'll need to populate the LRS with some records first.

@limikael
Copy link
Contributor

Ok! Will first also see if I maybe can create a Laravel module to install inside LearningLocker that calls the actual methods inside LearningLocker to set up an LRS. Might not be that much more work... Will see if it works on the first try... :)

@usernamenumber
Copy link
Contributor Author

...actually, I gave in and started messing around, and I think I've found what needs to be added to the provisioning system. Stay tuned!

@limikael
Copy link
Contributor

:)
On 12 May 2015 22:28, "Brad Smith" [email protected] wrote:

...actually, I gave in and started messing around, and I think I've found
what needs to be added to the provisioning system. Stay tuned!


Reply to this email directly or view it on GitHub
tunapanda/wikonnect#8 (comment).

@usernamenumber
Copy link
Contributor Author

Try pulling usernamenumber/ll_automation and see if it works. For me, with a fresh VM I now get LearningLocker with everything set up, and swagportal set up to use it, and Facebook auth! I think we might have a working dev environment! :D

@limikael
Copy link
Contributor

Didn't work for me on the first try, getting the good old 401 errors...

401
(Sorry, just learned about Lightshot, it's a lot of fun)

I wanted to login to LearningLocker to see if the LRS is created, how do I find out about the LearningLocker credentials?

@neerajkamdar
Copy link

I pulled usernamenumber/ll_automation and used the Facebook login. I didn’t see the Facebook login at first so I ran vagrant provision again. Then it seemed to work for me .. I see the screen below.

Great work guys!!

image

There is no interaction on the page. Is something supposed to happen when I click on the Levels.

I’m also still unclear on how to find the files in the VM. What login and password do I use?

Thanks,
Neeraj

On Wednesday, May 13, 2015 at 10:20 AM, Mikael Lindqvist wrote:

Didn't work for me on the first try, getting the good old 401 errors...

(Sorry, just learned about Lightshot, it's a lot of fun)
I wanted to login to LearningLocker to see if the LRS is created, how do I find out about the LearningLocker credentials?


Reply to this email directly or view it on GitHub (tunapanda/wikonnect#8 (comment)).

@usernamenumber
Copy link
Contributor Author

@neerajkamdar I don't see a screenshot there. Try editing your post and re-uploading?

@limikael Is this what happens when you do vagrant provision on your existing VM? Try doing a fresh clone (don't forget the -b usernamenumber/ll_automation!) and see if that works any better?

@limikael
Copy link
Contributor

I did:

git pull
vagrant destroy
rm -rf modules
git checkout usernamenumber/ll_automation
vagrant up

Will try with a fresh clone...

@limikael
Copy link
Contributor

@neerajkamdar Currently that's all that happens, it shows which levels you have completed...

Eventually what should happen, is that when you click on a "swagifact" (i.e. here the levels) you should get some information about what you need to do to complete that swagifact and collect the swag... In this case it would say something like:

In order to collect this swag you need to complete level ## in KTouch

Or something similar, and then there would be a screenshot and instructions on how to start KTouch.

If it would be something web based (such as KALite) it would take you directly to the url where you can do the KALite exercise that gives you the swag... It it is something not web based (like KTouch) there would just be instructions...

But all this remains to be done!

@usernamenumber
Copy link
Contributor Author

@limikael Hmm.. what you did probably should have worked, but here's hoping. If you do a fresh export, don't forget to create a new localconfig.yml so it uses the swag_dev profile.

@usernamenumber
Copy link
Contributor Author

Argh. Just tried this myself with a fresh vm, and now I'm getting the 401 errors as well. :( Will investigate.

@usernamenumber
Copy link
Contributor Author

If you try to go to the lrs view page in LL, it crashes, which might give us some clues for what we need to fix. My guess is there's something else that needs to be done in addition to just populating mongo.

@limikael
Copy link
Contributor

Laravel plugin... :)
On 13 May 2015 13:51, "Brad Smith" [email protected] wrote:

If you try to go to the lrs view page
http://learninglocker.dev.swag.tunapanda.org/lrs/55525735279871a1168b4567
in LL, it crashes, which might give us some clues for what we need to fix.
My guess is there's something else that needs to be done in addition to
just populating mongo.


Reply to this email directly or view it on GitHub
tunapanda/wikonnect#8 (comment).

@neerajkamdar
Copy link

I just added my screenshot again. Do you want me to test again by running the provisioning again?

screen shot 2015-05-13 at 12 02 42 pm

@usernamenumber
Copy link
Contributor Author

Nope, as Micke says, that's exactly what you should be seeing. The goal right now is to have an easily-deployable dev environment to make it easier to work on making that better. :)

...only now I'm really confused. If it's working for you, why is it not working for me or Micke??

@usernamenumber
Copy link
Contributor Author

Since I've been unable to automate this so far, and @limikael has proposed another approach we can try in #9, I'm closing this issue and suggesting that we move discussion there so we don't have two open issues for the same... issue.

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

No branches or pull requests

3 participants