I would like to share with you two other problems I encountered when using the cluster, others may encounter similar problems, I haven’t modified any code of Baserow.
export:
When I use the baserow cluster, because I use nginx, my request to export file will be forwarded to a server, and the file will be generated in the “MEDIA_ROOT” of this server, and then the request to download the file may be forwarded to other servers, which will lead to download failure.
Solutions:
I guess by configuring nginx, the export and download requests can be forwarded to the same server?
import:
When I import a file to create table, it often fails with the page shows: “Something went wrong during the file_import job execution.” , error in the backend log:
==> exportworker.error <==
[2022-12-05 11:41:05,313: INFO/MainProcess] Task baserow.core.jobs.tasks.run_async_job[4da34f10-9faa-4c14-bc98-1437e718e840] received
[2022-12-05 11:41:05,338: ERROR/ForkPoolWorker-6] Task baserow.core.jobs.tasks.run_async_job[4da34f10-9faa-4c14-bc98-1437e718e840] raised unexpected: FileNotFoundError(2, 'No such file or directory')
Traceback (most recent call last):
File "/home/baserow/python/virtual/env/lib/python3.8/site-packages/celery/app/trace.py", line 451, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/baserow/python/virtual/env/lib/python3.8/site-packages/celery/app/trace.py", line 734, in __protected_call__
return self.run(*args, **kwargs)
File "/home/baserow/backend/src/baserow/core/jobs/tasks.py", line 73, in run_async_job
raise e
File "/home/baserow/backend/src/baserow/core/jobs/tasks.py", line 36, in run_async_job
JobHandler().run(job)
File "/home/baserow/backend/src/baserow/core/jobs/handler.py", line 62, in run
return job_type.run(job, progress)
File "/home/baserow/backend/src/baserow/contrib/database/file_import/job_type.py", line 136, in run
with job.data_file.open("r") as fin:
File "/home/baserow/python/virtual/env/lib/python3.8/site-packages/django/db/models/fields/files.py", line 76, in open
self.file = self.storage.open(self.name, mode)
File "/home/baserow/python/virtual/env/lib/python3.8/site-packages/django/core/files/storage.py", line 38, in open
return self._open(name, mode)
File "/home/baserow/python/virtual/env/lib/python3.8/site-packages/django/core/files/storage.py", line 243, in _open
return File(open(self.path(name), mode))
FileNotFoundError: [Errno 2] No such file or directory: '/home/baserow/media/user_1/file_import/job__176.json'
It seems that Django’s FileField did not create a file for me under “MEDIA_ROOT/user/file_import”. when I check the server, the “job__176. json” file is not generated, but I will succeed after a few more attempts.
Solutions:
What puzzles me the most is why sometimes it succeeds and sometimes it fails? After failure, try a few more times to succeed, I have no solution yet.