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

error registering campaign view #1588

Closed
SKJoy opened this issue Nov 11, 2023 · 3 comments
Closed

error registering campaign view #1588

SKJoy opened this issue Nov 11, 2023 · 3 comments
Assignees
Labels
needs-investigation Potential bug. Needs investigation

Comments

@SKJoy
Copy link

SKJoy commented Nov 11, 2023

Version:

  • ListMonk: 2.5.1 (a6a2b69 2023-08-15T15:49:28Z, linux/amd64)
  • OS: Docker in AlmaLinux 8

Description of the bug and steps to reproduce:
Logs frequently coming up with the following error messages;

2023/11/11 05:32:13error registering campaign view: pq: null value in column "campaign_id" of relation "campaign_views" violates not-null constraint
2023/11/11 05:32:13error registering campaign view: code=500, message=Error updating Campaign: pq: null value in column "campaign_id" of relation "campaign_views" violates not-null constraint. Failing row contains (3101, null, null, 2023-11-11 05:32:13.375611+00).

This is also happening to another instance of LisMonk on another server.

@knadh
Copy link
Owner

knadh commented Nov 11, 2023

This could be because the views are coming in for a campaign that's been deleted. Could you please check whether that could be the case?

@knadh knadh added the needs-investigation Potential bug. Needs investigation label Nov 11, 2023
@SKJoy
Copy link
Author

SKJoy commented Nov 11, 2023

@knadh Yes I thought that too. Is it not possible to put something under the maintenance to clean up the database from those orphaned records? I tried the maintenance a few times, didn't resolve that VIEW ERROR issue :( Also, it is a bit difficult to inspect inside the database especially while ListMonk is from within Docker.

@knadh
Copy link
Owner

knadh commented Nov 11, 2023

There are no orphan records with campaigns. Once a campaign is deleted, it’s gone for good.

What is happening here is that users are opening email campaigns long after the campaign is deleted. listmonk is then unable to record that view.

I think the right approach here is to suppress this particular error from being logged as it’s an expected scenario. Will push a patch for this.

@knadh knadh self-assigned this Nov 11, 2023
@knadh knadh closed this as completed in b6922b0 Dec 7, 2023
ai-armageddon pushed a commit to Twitter-outreach/ListMonk that referenced this issue Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-investigation Potential bug. Needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants