UniversityOfSaskatchewanCMPT371 / term-project-2024-team-4

Apache License 2.0
2 stars 2 forks source link

backend crash frequently with unclear reasons #100

Closed xix695 closed 6 months ago

xix695 commented 6 months ago

when adding new sites or a few items the backend crashed and never recovered again until rebuilding everything.

error inform from the console: from client: Connection reset by peer term-project-2024-team-4-feature-projectile-backend-1 | [nodemon] app crashed - waiting for file changes before starting... term-project-2024-team-4-feature-projectile-postgres-1 | 2024-03-15 01:26:13.393 UTC [28] LOG: checkpoint starting: time term-project-2024-team-4-feature-projectile-postgres-1 | 2024-03-15 01:26:14.193 UTC [28] LOG: checkpoint complete: wrote 10 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.752 s, sync=0.010 s, total=0.800 s; sync files=9, longest=0.002 s, average=0.002 s; distance=1 kB, estimate=1 kB; lsn=0/1A1BCD8, redo lsn=0/1A1BCA0

when you see the last few sentences, might think it works again but actually not until rebuilding everything. then repeats the above story and crashes again and again.

Uv2002 commented 6 months ago

getting same issue

Uv2002 commented 6 months ago

frontend container is not working with docker and backend container is running but not giving any response when tried to called with postman

lecegues commented 6 months ago

After in-person discussion, we have found out that this issue was due to the most recent pull request #98 and the need for the newest .env file as shown in our GitHub wiki: Getting Started - Developers.

Solutions

A common fix for frequent errors related to this is to delete the postgres folder, which will basically reset the database and roles. Additionally, if the error code has JWTOKEN written, its best to clear the token cookie. This can be done by either going to settings & clearing cache/cookies, installing a cookie editor extension, or going into inspect/developer tools to clear it yourself.