Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX][BE] Fix API and DBMS error references #173

Merged
merged 3 commits into from
Jul 7, 2024
Merged

Conversation

Signed-off-by: Dicky Herlambang (花) <herlambangdicky5@gmail.com>
Error Info :
Missing foreign key (processId) with relation notifyLogs → appLogs, that causing issue failed to transact DB on notificationhelper module run

Payload :
Foreign key violation: 7 ERROR:  insert or update on table "notifyLogs" violates foreign key constraint "notifylogs_processid_foreign"

Environment :
Production

Root cause :
foreign key relation are not exist between notifylogs → applogs when insert transact happens

Resolution :
check and validate if processid between notifylogs → applogs is exists or not, if exists then do nothing. But if not exists then insert it before insert into notifylogs

Related Changes :
- app\Helpers\NotificationHelper.php

Signed-off-by: Dicky Herlambang (花) <herlambangdicky5@gmail.com>
Error Info :
On endpoint api/v1/logs/proc/all when using parameter logOrder → asc and logType → access, it throwback error message column \"procStartAt\" does not exist due undefined column in that table. And it causing BE services returning 500 instead of 200

Payload :
SQLSTATE[42703]: Undefined column: 7 ERROR: column \"procStartAt\" does not exist\nLINE 1: select  *from \"accessLogs\" order by \"procStartAt\" desc limit...\n
^ (Connection: pgsql, SQL: select*  from \"accessLogs\" order by \"procStartAt\" desc limit 1000)"

Environment :
Production

Step to reproduce :
- access endpoint api/v1/logs/proc/all
- use this parameter:
	* logCount → 1000
	* logResult → true
	* logType → access
	* logOrder → asc

Root cause :
Column “procStartAt” are not exist on accessLog table

Resolution :
Drop filter order by “procStartAt” on getAllLogs function only for access table

Related Changes :
app\Http\Controllers\Api\Data\notifyLogController.php

Signed-off-by: Dicky Herlambang (花) <herlambangdicky5@gmail.com>
@Nicklas373 Nicklas373 added bug Something isn't working dependencies Pull requests that update a dependency file php Pull requests that update Php code labels Jul 7, 2024
@Nicklas373 Nicklas373 self-assigned this Jul 7, 2024
@Nicklas373 Nicklas373 merged commit bd00ab1 into be/master Jul 7, 2024
2 checks passed
@Nicklas373 Nicklas373 deleted the dev/be/master branch July 7, 2024 06:15
@Nicklas373 Nicklas373 restored the dev/be/master branch July 7, 2024 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant