akaunting / docker

Docker Image for Akaunting
https://github.com/akaunting/akaunting
GNU General Public License v3.0
189 stars 88 forks source link

Error 500 when accessing transaction or customer details #100

Closed vitis586 closed 1 year ago

vitis586 commented 1 year ago

I managed to install 3.1.2 yesterday. Previously I was getting just a lot of errors and the login page would not even show up but it installed this time. Everything showed up, all the transactions are there but if I want to see a detail of anything I am getting an error 500. When I want to see the transaction or a customer I get the 500. When accessed over API it is the same.

This is a log when I tried to search for a customer for example.

{"status":"rejected","reason":{"message":"500 - \"{\\"message\\":\\"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'akaunting.ako_contact_persons' doesn't exist (Connection: mysql, SQL: select from ako_contact_persons where ako_contact_persons.contact_id = 6 and ako_contact_persons.contact_id is not null and ako_contact_persons.deleted_at is null and ako_contact_persons.company_id = 1)\\",\\"code\\":\\"42S02\\",\\"status_code\\":500}\"","name":"Error","stack":"Error: 500 - \"{\\"message\\":\\"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'akaunting.ako_contact_persons' doesn't exist (Connection: mysql, SQL: select from ako_contact_persons where ako_contact_persons.contact_id = 6 and ako_contact_persons.contact_id is not null and ako_contact_persons.deleted_at is null and ako_contact_persons.company_id = 1)\\",\\"code\\":\\"42S02\\",\\"status_code\\":500}\"\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at RedirectableRequest.handleResponse (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:238:9)\n at RedirectableRequest.emit (node:events:529:35)\n at RedirectableRequest.emit (node:domain:489:12)\n at RedirectableRequest._processResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:368:10)\n at ClientRequest.RedirectableRequest._onNativeResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:65:10)\n at Object.onceWrapper (node:events:632:26)\n at ClientRequest.emit (node:events:517:28)\n at ClientRequest.emit (node:domain:489:12)"}}

For now I am rolled back to 3.0.17 in production. I have tried all the 3.1 versions and they behave the same for me - getting 500s when I access details of a transaction or a customer.

I have now just one user so I fulfilled the requirements for the new on-premise plan and I have filled in the API key. I am no longer getting the banner that I am over the limit with my number of users. Is anyone else encountering this? I also had a look on the forums but there is nothing related to this error.

vitis586 commented 1 year ago

I figured out that the database migration was not happening. I ran tag 3.1.0 with AKAUNTING_SETUP=true, that run the migration. and then I turned off the AKAUNTING_SETUP. I then proceeded with update to the 3.1.2 and settling to the current digest. I did all this with help of my testing container.

  1. Backup production db
  2. Load production db to testing
  3. Start testing with AKAUNTING_SETUP=true and tag :3.1.0 (setup currently does not work, so it will not affect your db)
  4. Check two new tables - details in https://github.com/akaunting/akaunting/blob/master/database/migrations/2023_10_03_000000_core_v310.php
  5. Backup testing db
  6. Load testing db to production
  7. Start testing with AKAUNTING_SETUP=false and tag :3.1.0
  8. Update to tag :3.1.2 and lock to current digest