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

Non-existent password ref #11769

Closed
rtibbles opened this issue Jan 23, 2024 · 12 comments
Closed

Non-existent password ref #11769

rtibbles opened this issue Jan 23, 2024 · 12 comments
Assignees
Labels
P2 - normal Priority: Nice to have

Comments

@rtibbles
Copy link
Member

Observed behavior

In the https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/plugins/setup_wizard/assets/src/views/SelectSuperAdminAccountForm.vue component, this.$refs.password is always undefined, which can give an unhandled error during certain operations.

Errors and logs

First reported here: https://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/plugins/setup_wizard/assets/src/views/SelectSuperAdminAccountForm.vue

Expected behavior

References to non-existent refs should be removed.

User-facing consequences

Seemingly none.

@rtibbles rtibbles added the P2 - normal Priority: Nice to have label Jan 23, 2024
@himanshuc3
Copy link

@rtibbles It seems like most places have a check for it's access. If it's undefined everytime, where is it being used and why is it being referenced?

@rtibbles
Copy link
Member Author

My guess is that this is the result of a copy paste of code, or changes in the component template that were not matched in the component script. We should just remove any that are actually undefined to avoid this.

@himanshuc3
Copy link

Can you help me with reproducing this error though. I can't see where the form is triggered. I feel the paths should have a clearer 1:1 mapping from the path string to the path user enters in browser.

  • I tried directly hitting the path import-facility/select-admin but it gives a 404.
  • Going to Device/Facilities page and trying to import facility, I am not able to get past Select Device modal.
    There needs to be a test facility that can be imported with dummy creds to test this flow.

@MisRob
Copy link
Member

MisRob commented Mar 19, 2024

Hi @himanshuc3, I don't understand exactly this issue but from your last comment it sounds that you need to have access to the import facility feature? If that's the case, one way to achieve that is to run another Kolibri instance as described here https://kolibri-dev.readthedocs.io/en/develop/howtos/another_kolibri_instance.html

@himanshuc3
Copy link

thanks @MisRob let me try that and get back.

@himanshuc3
Copy link

SelectSuperAdminForm doesn't come in the flow that I am going through @MisRob .
Screenshot from 2024-03-20 10-38-29
Here I click on import facility cta and select device -> select learning facility -> enter admin creds. Nowhere here is the form SelectSuperAdminForm triggered.

@MisRob
Copy link
Member

MisRob commented Mar 22, 2024

Ah this one is tricky to find @himanshuc3.

  • First run another Kolibri instance via pex as described in the guide I referenced earlier. Complete the setup wizard on that instance.
  • Then run your Kolibri development server with a different KOLIBRI_HOME folder so that you have a brand new instance and can access the setup wizard KOLIBRI_HOME=~/.kolibri-2 yarn run devserver-hot

Then you can follow this recording:
super admin

@himanshuc3
Copy link

I was initially using the command KOLIBRI_HOME="<foldername>" python <filename>.pex start. It was working but somehow I still wasn't getting to the component in the flow.
Running using yarn run devserver with a different kolibri env is easier but it throws the error:

watch] /home/himanshu/Desktop/projects/learningequality/kolibri/node_modules/webpack-dev-server/lib/Server.js:2344
[watch]         throw error;
[watch]         ^
[watch] 
[watch] Error: listen EADDRINUSE: address already in use 0.0.0.0:3000
[watch]     at Server.setupListenHandle [as _listen2] (node:net:1817:16)
[watch]     at listenInCluster (node:net:1865:12)
[watch]     at doListen (node:net:2014:7)
[watch]     at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
[watch]   code: 'EADDRINUSE',
[watch]   errno: -98,
[watch]   syscall: 'listen',
[watch]   address: '0.0.0.0',
[watch]   port: 3000
[watch] }
[watch] 
[watch] Node.js v18.19.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I don't see any related key in options.ini to change it, so don't know whether it's configurable.

@bjester
Copy link
Member

bjester commented Mar 26, 2024

@himanshuc3 On your second instance, instead of running the yarn run devserver, you could run:

  1. yarn run build to build the frontend resources
  2. pip install -e . to 'install' the kolibri package
  3. KOLIBRI_HOME="<foldername>" kolibri start --foreground --port <alt> to start on <alt> port that you specify, with alternative KOLIBRI_HOME

@himanshuc3
Copy link

I am able to run the 2 instances now. Thanks @bjester @MisRob for the help.

There might be an unrelated bug though, because as soon as I try to use the earlier instance (running on port 8000) which was ran using yarn run devserver and go to device -> facilities on it,page it logs me out instantaneously.

Screenshot from 2024-03-27 13-42-46

@rtibbles
Copy link
Member Author

Yes - unfortunately, cookies are shared across the same host, even if the port is different. So if you need to interact with both servers, you would need to use two separate browser sessions.

@jredrejo
Copy link
Member

Fixed in #12077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 - normal Priority: Nice to have
Projects
None yet
Development

No branches or pull requests

5 participants