Export not working on 21.09.4

Hi

We started the survey using version 21.06.3, interviews coming in, everything working as expected, export was fine (using both GUI and API).

And then, it stopped working after a few days, so we upgraded the server to version 21.09.4.

Export (STATA, TABULAR) is still failing:

2021-12-02 18:12:01.725 +00:00 [INF] Start job execution [hq {"ExportSettings":{"JobId":null,"ExportFormat":2,"QuestionnaireId":{"Id":"5c8ef8f36fc04cd3994994caa4c583fb$5"},"Status":null,"FromDate":null,"ToDate":null,"Tenant":{"BaseUrl":https://hq305.surveys.spc.int/primary,"Id":{"Id":"f61fa942-df9c-4111-88f5-9e064a24e17e"},"Name":"hq","ShortName":"hq","Workspace":"primary"},"Translation":null,"IncludeMeta":null,"NaturalId":"f61fa942-df9c-4111-88f5-9e064a24e17e$All$STATA$5c8ef8f36fc04cd3994994caa4c583fb$5$EMPTY FROM DATE$EMPTY TO DATE$No translation"},"Status":{"CreatedDate":"0001-01-01T00:00:00","BeginDate":null,"EndDate":null,"LastUpdateDate":"0001-01-01T00:00:00","Status":2,"JobStatus":0,"ProgressInPercents":0,"IsRunning":false,"TimeEstimation":null,"Error":null},"ArchivePassword":null,"NaturalId":"NoExternal$f61fa942-df9c-4111-88f5-9e064a24e17e$All$STATA$5c8ef8f36fc04cd3994994caa4c583fb$5$EMPTY FROM DATE$EMPTY TO DATE$No translation","AccessToken":null,"RefreshToken":null,"StorageType":null,"ProcessId":0,"ShouldDropTenantSchema":false}]
2021-12-02 18:12:31.788 +00:00 [WRN] Request failed with "InternalServerError". Waiting "00:00:02" before next retry. Retry attempt 1
2021-12-02 18:13:03.839 +00:00 [WRN] Request failed with "InternalServerError". Waiting "00:00:04" before next retry. Retry attempt 2
2021-12-02 18:13:37.893 +00:00 [WRN] Request failed with "InternalServerError". Waiting "00:00:08" before next retry. Retry attempt 3
2021-12-02 18:13:45.894 +00:00 [INF] Database refresh done. Took 0:01:44.1548759
2021-12-02 18:13:45.895 +00:00 [WRN] Job cancelled [ {"ExportSettings":{"JobId":null,"ExportFormat":2,"QuestionnaireId":{"Id":"5c8ef8f36fc04cd3994994caa4c583fb$5"},"Status":null,"FromDate":null,"ToDate":null,"Tenant":{"BaseUrl":https://hq305.surveys.spc.int/primary,"Id":{"Id":"f61fa942-df9c-4111-88f5-9e064a24e17e"},"Name":"hq","ShortName":"hq","Workspace":"primary"},"Translation":null,"IncludeMeta":null,"NaturalId":"f61fa942-df9c-4111-88f5-9e064a24e17e$All$STATA$5c8ef8f36fc04cd3994994caa4c583fb$5$EMPTY FROM DATE$EMPTY TO DATE$No translation"},"Status":{"CreatedDate":"0001-01-01T00:00:00","BeginDate":null,"EndDate":null,"LastUpdateDate":"0001-01-01T00:00:00","Status":2,"JobStatus":0,"ProgressInPercents":0,"IsRunning":false,"TimeEstimation":null,"Error":null},"ArchivePassword":null,"NaturalId":"NoExternal$f61fa942-df9c-4111-88f5-9e064a24e17e$All$STATA$5c8ef8f36fc04cd3994994caa4c583fb$5$EMPTY FROM DATE$EMPTY TO DATE$No translation","AccessToken":null,"RefreshToken":null,"StorageType":null,"ProcessId":0,"ShouldDropTenantSchema":false} ]
2021-12-02 18:14:01.664 +00:00 [INF] Job #47 'NoExternal$f61fa942-df9c-4111-88f5-9e064a24e17e$All$STATA$5c8ef8f36fc04cd3994994caa4c583fb$5$EMPTY FROM DATE$EMPTY TO DATE$No translation' marked as "Created" due to inactivity

So upgrade doesn’t seem to be related here, the problem started occurring in the 21.06 and moving to 21.09 didn’t help.

You’re specifically mentioning Stata and Tabular, does this mean that SPSS export works or you simply haven’t tried that?

Yes, after some testing and tweaking done with Sergyi and Vitaliy we finally got export working.
Long story short the server is getting a lot of requests to deal with and postgres was not responding well.
Extending the number of possible connections with the database seems to do the trick so far.
(and yes, I only export Stata or Tabular)