Not able to import follows csv

I’m moving to a self-hosted akkoma instance (on latest develop), and I tried to import a follows csv with ~450 entries.

After clicking the submit button, the web UI says “Follows imported! Processing them will take a while.”, but only 2-3 accounts were actually imported even after 30 minutes.

I poked around a bit in the postgresql DB, and found a table called oban_jobs. I tried importing again with 25 account this time, and saw this entry in that table (it gets cleaned up automatically in a few minutes):

id           | 166630
state        | discarded
queue        | background
worker       | Pleroma.Workers.BackgroundWorker
args         | {"op": "follow_import", "user_id": "xxx", "identifiers": [<list of 25 users>]}
errors       | {"{\"at\": \"2022-11-24T10:31:31.637367Z\", \"error\": \"** (Oban.TimeoutError) Pleroma.Workers.BackgroundWorker timed out after 5000ms\", \"attempt\": 1}"}
attempt      | 1
max_attempts | 1
inserted_at  | 2022-11-24 10:31:26.626525
scheduled_at | 2022-11-24 10:31:26.626525
attempted_at | 2022-11-24 10:31:26.633714
completed_at | 
attempted_by | {c533e1c295b0}
discarded_at | 2022-11-24 10:31:31.637362
priority     | 0
tags         | {}
meta         | {}
cancelled_at |

Is there something I can do to debug this further?

As discussed on IRC, this looks to be because the job for this import has a short timeout (5 seconds).

Temp solution that worked for me:
Go to admin-fe → Settings → Job queue → Timeout → :background => Set to a very large value like 7200000 (equivalent to 2 hours).
After this change, importing works.
After importing, the setting can be reverted back to the default 5000.

Better solution for this will need code change, that can be tracked at: #306 - Rework User.Import to spin off a bunch of jobs instead of single-threading the task - akkoma - Akkoma Development

will be fixed by #319 - Spin off imports into n oban jobs - akkoma - Akkoma Development

1 Like