ProfileEditPage route is broken
Observed behavior
When viewing your profile, if you click "Edit" the console shows the error that the ShowEditProfile route does not exist.
There is a route defined - I'm suspecting something is just wired up wrongly somewhere but I'm not seeing where at a quick glance.
Expected behavior
Users should be able to edit their profile.
User-facing consequences
User couldn't edit their profile.
Steps to reproduce
Start devserver, sign in, try to edit your profile.
Context
0.16 Fedora 36 Chromium
Hi @nucleogenesis I would like to work on this issue :innocent:
Hello @camperjett, thank you for your interest, you're welcome to take this on
@camperjett Please see our developer's documentation if you haven't done so already. There should be everything you need to get started.
@camperjett As soon as you start working on it, please let us know and we will assign you the issue so that we know it's taken
Thanks @MisRob. I have setup the environment. But while creating my first superuser on main page prompt I got this error:
ERROR Internal Server Error: /setup/api/facilityimport/createsuperuser/ Traceback (most recent call last): File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view return view_func(*args, **kwargs) File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/rest_framework/viewsets.py", line 116, in view return self.dispatch(request, *args, **kwargs) File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 495, in dispatch response = self.handle_exception(exc) File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 455, in handle_exception self.raise_uncaught_exception(exc) File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 492, in dispatch response = handler(request, *args, **kwargs) File "/home/jd/projects/open-source/kolibri/kolibri/plugins/setup_wizard/api.py", line 90, in createsuperuser the_facility = Facility.objects.get() File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/jd/projects/open-source/kolibri/.venv/lib/python3.10/site-packages/django/db/models/query.py", line 378, in get raise self.model.DoesNotExist( kolibri.core.auth.models.DoesNotExist: Facility matching query does not exist. INFO 127.0.0.1 - - "POST /setup/api/facilityimport/createsuperuser/" 500 0 "http://127.0.0.1:8000/en/setup/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
@camperjett Ah, thanks for reporting. Is this on the develop branch? We may have some work in progress with the setup wizard that could be causing this. If that's the case, could you please try to use release-v0.15.x branch instead, go through the setup, and after setup is complete, switch back to develop (where you could try if you can reproduce the bug)? I can't try it out now but I did this locally a couple of days ago and it has helped me. If it's not branch related or you encounter some other issues, please let us know, and I'll investigate or ask someone else on the team to help.
Let us know how it goes. I'll check it out here again tomorrow.
@camperjett Note that you will need to reinstall dependencies etc. after switching between develop and release-v0.15.x
Okay 🙌 and Thanks!
@MisRob I am not able to get past the error.
File "/home/jd/projects/open-source/kolibri/kolibri/plugins/setup_wizard/api.py", line 90, in createsuperuser the_facility = Facility.objects.get()
In this line, it seems to query for Facility objects but they do not exist at the start and hence the error. Is there any way out?
@camperjett Could you send me steps to reproduce, please? Branch, browser, browser console output, and also what you clicked during the setup (there are more options). It will help us to investigate and resolve this faster. Thank you for patience and cooperation :)
@camperjett I checked on this with the team, and I can confirm we have some work in progress on develop that is causing this. As I mentioned above, you can resolve it by going through the setup on release-v0.15.x branch. I tried to do it earlier today (Quick Setup option), and it worked well. After the setup, when you have the facility ready, you can switch back to develop (most likely you'll also need to reinstall dependencies and maybe run migrations after switching the branch). If you have some issues with the setup wizard on release-v0.15.x branch, please post the steps to reproduce because I haven't encountered such an issue there myself.
@camperjett Also, if the above doesn't help, you can try to delete db.sqlite3 file (in Kolibri home folder which is ~/.kolibri by default) before trying the setup again on release-v0.15.x branch to make sure you get a clean start
Thanks @MisRob. Will try it 😁
I tried using release-v0.15.x but on running yarn install I am getting this errror:
yarn install v1.22.19 $ node ./packages/kolibri-tools/lib/npm_deprecation_warning.js [1/5] Validating package.json... error [email protected]: The engine "node" is incompatible with this module. Expected version "10.x". Got "16.13.2" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Also I tried $ nodeenv -p --node=10.13.0 but again got error:
yarn install v1.22.19
$ node ./packages/kolibri-tools/lib/npm_deprecation_warning.js [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... error An unexpected error occurred: "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz: getaddrinfo EAI_AGAIN registry.yarnpkg.com registry.yarnpkg.com:443". info If you think this is a bug, please open a bug report with the information provided in "/home/jd/projects/open-source/kolibri/yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. warning [email protected]: Invalid bin field for "file-loader". warning [email protected]: Invalid bin field for "url-loader".
NOTE: I am using venv for creating the environment.
@camperjett Yes, that's right, you need to use Node v10 on the release branch and Node v16 on develop. Node version is set in package.json and this error gets generated from it to notify developers that there's a need to switch versions.
Regarding the second error, this seems like some network troubles to me - a problem with the registry or maybe your connection when installing packages. Have you tried running installation more times? If it persists, please let us know.
I have finally got the local environment working!
Woohoo! Thanks for your patience and for reporting all issues, that's an important contribution as well :) Seems to be quite a rare constellation related to some work in progress and discrepancy in Node versions before the next release. In any case, we'll chat with the team about how we can make sure next time that workflows that are critical to starting work on develop from scratch are at least basically functional.
@camperjett I assigned you (+myself only to keep an eye) so that we know that it's taken already
@MisRob PTAL
@camperjett Great, thanks, I will review it next week.