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

App restart via the UI causes an error #165

Open
rtibbles opened this issue Oct 9, 2023 · 0 comments
Open

App restart via the UI causes an error #165

rtibbles opened this issue Oct 9, 2023 · 0 comments
Assignees
Labels

Comments

@rtibbles
Copy link
Member

rtibbles commented Oct 9, 2023

Observed behavior

When trying to toggle device settings that require a restart (such as enabled plugins), the app crashes.

Errors and logs

2023-10-09 10:55:53.821  5845-5917  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:53,816 127.0.0.1 - - "POST /api/device/devicerestart/" 200 0 "http://127.0.0.1:57967/en/device/" "Mozilla/5.0 (Linux; Android 7.1.1; Android SDK built for x86 Build/NYC; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36"
2023-10-09 10:55:53.924  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:53,923 Restarting server.
2023-10-09 10:55:53.925  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:53,924 Bus state: STOP
2023-10-09 10:55:54.038  5845-5845  art                     org.learningequality.Kolibri         W  Attempt to remove non-JNI local reference, dumping thread
2023-10-09 10:55:54.071  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:54,071 HTTP Server kolibri.utils.server.Server(('0.0.0.0', 55884)) shut down
2023-10-09 10:55:54.313  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:54,312 HTTP Server kolibri.utils.server.Server(('0.0.0.0', 57967)) shut down
2023-10-09 10:55:54.313  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:54,313 Joining 'ZeroConfPlugin'
2023-10-09 10:55:54.315  5845-5845  art                     org.learningequality.Kolibri         W  Attempt to remove non-JNI local reference, dumping thread
2023-10-09 10:55:54.600  5845-5845  art                     org.learningequality.Kolibri         W  Attempt to remove non-JNI local reference, dumping thread
2023-10-09 10:55:54.929  5845-5845  art                     org.learningequality.Kolibri         W  Attempt to remove non-JNI local reference, dumping thread
2023-10-09 10:55:54.942  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:54,941 Stopped thread 'ZeroConfPlugin'.
2023-10-09 10:55:54.948  5845-5856  art                     org.learningequality.Kolibri         I  Background sticky concurrent mark sweep GC freed 7(328B) AllocSpace objects, 0(0B) LOS objects, 0% free, 27MB/27MB, paused 6.699ms total 11.667ms
2023-10-09 10:55:54.995  5845-5914  TaskworkerWorker        org.learningequality.Kolibri         V  Request data: Data {LONG_RUNNING_ARGUMENT : false, PYTHON_WORKER_ARGUMENT : 1000, androidx.work.impl.workers.RemoteListenableWorker.ARGUMENT_CLASS_NAME : org.learningequality.Kolibri.TaskworkerWorkerService, androidx.work.impl.workers.RemoteListenableWorker.ARGUMENT_PACKAGE_NAME : org.learningequality.Kolibri, }
2023-10-09 10:55:55.252  5845-5845  art                     org.learningequality.Kolibri         W  Attempt to remove non-JNI local reference, dumping thread
2023-10-09 10:55:55.264  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:55,263 Bus state: IDLE
2023-10-09 10:55:55.265  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:55,264 Bus state: EXIT
2023-10-09 10:55:55.267  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:55,266 Waiting for child threads to terminate...
2023-10-09 10:55:55.268  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:55,267 Bus state: EXITED
2023-10-09 10:55:55.269  5845-5914  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:55,268 Re-spawning notaninterpreterreally
2023-10-09 10:55:55.278  5845-5890  python                  org.learningequality.Kolibri         I  INFO     2023-10-09 17:55:55,268 Re-spawning notaninterpreterreally
2023-10-09 10:55:55.355  5845-5890  python                  org.learningequality.Kolibri         I  ERROR    2023-10-09 17:55:55,288 Error in 'execv' listener <bound method Execv.execv of <magicbus.plugins.lifecycle.Execv object at 0x8df48058>>
2023-10-09 10:55:55.355  5845-5890  python                  org.learningequality.Kolibri         I  Traceback (most recent call last):
2023-10-09 10:55:55.355  5845-5890  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 273, in publish
2023-10-09 10:55:55.355  5845-5890  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/plugins/lifecycle.py", line 92, in execv
2023-10-09 10:55:55.355  5845-5890  python                  org.learningequality.Kolibri         I  ValueError: execv() arg 2 first element cannot be empty
2023-10-09 10:55:55.355  5845-5890  python                  org.learningequality.Kolibri         I  
2023-10-09 10:55:55.355  5845-5890  python                  org.learningequality.Kolibri         I  Traceback (most recent call last):
2023-10-09 10:55:55.355  5845-5890  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/src/main.py", line 83, in <module>
2023-10-09 10:55:55.356  5845-5890  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/utils/server.py", line 739, in run
2023-10-09 10:55:55.356  5845-5890  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/process.py", line 156, in block
2023-10-09 10:55:55.356  5845-5890  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 291, in publish
2023-10-09 10:55:55.356  5845-5890  python                  org.learningequality.Kolibri         I  magicbus.base.ChannelFailures: ValueError('execv() arg 2 first element cannot be empty')
2023-10-09 10:55:55.356  5845-5890  python                  org.learningequality.Kolibri         I  Python for android ended.
2023-10-09 10:55:55.362  5845-5914  python                  org.learningequality.Kolibri         I  ERROR    2023-10-09 17:55:55,300 Error in 'EXITED' listener <bound method Execv.execv of <magicbus.plugins.lifecycle.Execv object at 0x8df48058>>
2023-10-09 10:55:55.362  5845-5914  python                  org.learningequality.Kolibri         I  Traceback (most recent call last):
2023-10-09 10:55:55.362  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 273, in publish
2023-10-09 10:55:55.362  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/plugins/lifecycle.py", line 92, in execv
2023-10-09 10:55:55.362  5845-5914  python                  org.learningequality.Kolibri         I  ValueError: execv() arg 2 first element cannot be empty
2023-10-09 10:55:55.362  5845-5914  python                  org.learningequality.Kolibri         I  
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I  ERROR    2023-10-09 17:55:55,362 Error in background task thread function <bound method ProcessControlPlugin.run of <kolibri.utils.server.ProcessControlPlugin object at 0x90068730>>.
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I  Traceback (most recent call last):
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/plugins/tasks.py", line 90, in run
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/utils/server.py", line 594, in run
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/process.py", line 128, in restart
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 186, in transition
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 215, in _transition
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 291, in publish
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I  magicbus.base.ChannelFailures: ValueError('execv() arg 2 first element cannot be empty')
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I  
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I  Exception in thread ProcessControlPlugin:
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I  Traceback (most recent call last):
2023-10-09 10:55:55.374  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/other_builds/python3/x86__ndk_target_23/python3/Lib/threading.py", line 980, in _bootstrap_inner
2023-10-09 10:55:55.375  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/plugins/tasks.py", line 90, in run
2023-10-09 10:55:55.375  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/utils/server.py", line 594, in run
2023-10-09 10:55:55.375  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/process.py", line 128, in restart
2023-10-09 10:55:55.375  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 186, in transition
2023-10-09 10:55:55.375  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 215, in _transition
2023-10-09 10:55:55.375  5845-5914  python                  org.learningequality.Kolibri         I    File "/home/richard/github/kolibri-installer-android/python-for-android/build/python-installs/kolibri/x86/kolibri/dist/magicbus/base.py", line 291, in publish
2023-10-09 10:55:55.375  5845-5914  python                  org.learningequality.Kolibri         I  magicbus.base.ChannelFailures: ValueError('execv() arg 2 first element cannot be empty')

Expected behavior

The App should properly restart the Python process.

This should be achieved by creating a custom restart hook function that will properly handle restarting the Python process on Android and then passing that as the restart hook via an environment variable.

User-facing consequences

Not able to update important settings such as the file system path.

Steps to reproduce

Update the available plugins.
Save changes.

@rtibbles rtibbles added the bug label Oct 9, 2023
@rtibbles rtibbles self-assigned this Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant