Skip to content

Error On First Run, Relates to SQLite3? #1

@NateEaton

Description

@NateEaton

Interesting project that looks like it would meet my needs but after installing and configuring I get an error on the first run that I am not clear how to resolve. I'm including the output below.

BTW, a few points to share, the first two of which may relate directly to the issue:

  • I do not see anything indicating which Raspberry Pi models this has been tested on. I am using a Pi Zero 2 W.
  • I do not see anything indicating which Raspberry OS to run this on. I have tried it on the full Bookworm install and on the full legacy Bullseye install. On the former, I had to change requirements.txt to install pyyaml version 6.0.1 as version 6.0 failed with a dependency error relating to cython but it still had a first run error that relates to sqlite3. On the latter, I get an error on first run and the output below is from this version. Can/should this be installed on a lite version? It doesn't seem like that would have anything to do with this issue but if the full desktop and other apps (e.g., browser) aren't needed, I'd rather not install them.
  • You have a few documentation typos, a reference to "env" instead of "venv" on the doc overview page instructions for setting up a virtual environment, and in the apt-get statement there is a reference to "x11-server-utils" that should be "x11-server-utils".

Output:
`(venv) pi@Framarama:~/framarama $ python manage.py runserver --noreload
Scheduler started
Added job "Config source updates" to job store "default"
Added job "Config source updates triggered" to job store "default"
Running job "Config source updates triggered (trigger: date[2024-07-27 14:34:21 UTC], next run at: 2024-07-27 14:34:21 UTC)" (scheduled at 2024-07-27 14:34:21.237985+00:00)
Removed job cfg_source_update_1722090861.235239
Job "Config source updates triggered (trigger: date[2024-07-27 14:34:21 UTC], next run at: 2024-07-27 14:34:21 UTC)" raised an exception
Traceback (most recent call last):
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 477, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: config_source

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/pi/framarama/venv/lib/python3.9/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/home/pi/framarama/framarama/jobs.py", line 38, in
self._scheduler.add_job(lambda *args, **kwargs: func(*args, **kwargs), id=job_id, args=_func_args, kwargs=_func_kwargs, *args, **kwargs)
File "/home/pi/framarama/config/jobs.py", line 55, in source_update
for _source in models.Source.objects.filter(_criteria).order_by('-update_date_start'):
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/models/query.py", line 320, in iter
self._fetch_all()
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/models/query.py", line 1507, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/models/query.py", line 57, in iter
results = compiler.execute_sql(
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1361, in execute_sql
cursor.execute(sql, params)
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 477, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: config_source
Scheduler started
Run "which xinput": code=0, stdout=16 bytes, stderr=0 bytes
Run "which xmodmap": code=0, stdout=17 bytes, stderr=0 bytes
Error running "pidof xinput": code=1, stdout=b'', stderr=b''
Error running "xmodmap -pke": code=1, stdout=b'', stderr=b"xmodmap: unable to open display ''\n"
Traceback (most recent call last):
File "/home/pi/framarama/manage.py", line 22, in
main()
File "/home/pi/framarama/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/core/management/init.py", line 420, in execute
django.setup()
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/pi/framarama/venv/lib/python3.9/site-packages/django/apps/registry.py", line 124, in populate
app_config.ready()
File "/home/pi/framarama/framarama/apps.py", line 36, in ready
self.setup_frontend()
File "/home/pi/framarama/frontend/apps.py", line 11, in setup_frontend
self._scheduler.start()
File "/home/pi/framarama/framarama/jobs.py", line 118, in start
self.configure()
File "/home/pi/framarama/frontend/jobs.py", line 49, in configure
self._monitor.start()
File "/home/pi/framarama/framarama/base/frontend.py", line 593, in start
self._verify_running()
File "/home/pi/framarama/framarama/base/frontend.py", line 580, in _verify_running
self._keymap = [_line.split() for _line in Process.exec_run(['xmodmap', '-pke']).split(b'\n')]
AttributeError: 'NoneType' object has no attribute 'split'`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions