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

Mark all as read not working in 4.1.0 #1187

Closed
cdemi opened this issue Jan 12, 2024 · 11 comments
Closed

Mark all as read not working in 4.1.0 #1187

cdemi opened this issue Jan 12, 2024 · 11 comments
Labels

Comments

@cdemi
Copy link

cdemi commented Jan 12, 2024

Describe the bug
After upgrading to 4.1.0, the button Mark all as Read seems to be broken. Downgarding to 4.0.0 makes the button work again

To Reproduce
Press the header button "Mark all as Read"

Environment (please complete the following information):

  • CommaFeed version (or "commafeed.com"): 4.1.0 (Docker)
  • Browser [e.g. chrome, firefox]: Chrome
  • Device [e.g. desktop, mobile]: Desktop
chrome_aFbnTxptI1.mp4

Not sure if these postgres logs are related/helpful to you:

2024-01-12 14:55:49.617 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:55:49.617 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:55:49.617 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:55:50.709 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:55:50.709 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:55:50.709 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:55:51.570 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:55:51.570 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:55:51.570 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:56:21.696 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:56:21.696 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:56:21.696 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:56:22.397 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:56:22.397 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:56:22.397 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:56:23.590 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:56:23.590 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:56:23.590 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:56:24.219 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:56:24.219 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:56:24.219 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:56:25.529 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:56:25.529 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:56:25.529 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:56:27.065 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:56:27.065 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:56:27.065 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:56:27.639 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:56:27.639 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:56:27.639 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:56:40.094 UTC [14] LOG:  checkpoint starting: time
2024-01-12 14:56:56.832 UTC [14] LOG:  checkpoint complete: wrote 169 buffers (1.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=16.687 s, sync=0.008 s, total=16.739 s; sync files=44, longest=0.006 s, average=0.001 s; distance=1907 kB, estimate=1907 kB; lsn=8/7CBDF818, redo lsn=8/7CB9D3A0
2024-01-12 14:57:32.863 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:57:32.863 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:57:32.863 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
2024-01-12 14:57:34.325 UTC [83] ERROR:  duplicate key value violates unique constraint "jettysessions_pkey"
2024-01-12 14:57:34.325 UTC [83] DETAIL:  Key (sessionid, contextpath, virtualhost)=(node0v280zoane759rdf88mvftygu0, , 0.0.0.0) already exists.
2024-01-12 14:57:34.325 UTC [83] STATEMENT:  insert into JettySessions (sessionId, contextPath, virtualHost, lastNode, accessTime, lastAccessTime, createTime, cookieTime, lastSavedTime, expiryTime, maxInterval, map)  values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
@Athou
Copy link
Owner

Athou commented Jan 12, 2024

All rows of the JettySessions table should have been deleted with 4.1.0. I guess it didn't work for you? It worked for me locally and for www.commafeed.com though.

Is the case of the table in your database different perhaps? Could you try to delete all rows in the table and try again?

@cdemi
Copy link
Author

cdemi commented Jan 12, 2024

Hmm.. I have dropped the table manually and restarted the container but I still get the same error. Unless I am doing something wong

@Athou
Copy link
Owner

Athou commented Jan 12, 2024

Do you have an application error in the logs of CommaFeed?

@cdemi
Copy link
Author

cdemi commented Jan 12, 2024

So I did indeed drop the table wrong. Now I dropped it again and restarted the container and I don't get the duplicate key error. However Mark as Read still doesn't work.

Application Logs don't show any errors after startup and I don't see any Javascript console errors either

INFO  [2024-01-12 18:02:55,176] com.commafeed.CommaFeedModule: using cache class com.commafeed.backend.cache.NoopCacheService
INFO  [2024-01-12 18:02:55,754] com.commafeed.backend.task.ScheduledTask: registering task OldStatusesCleanupTask for execution every 60 MINUTES, starting in 15 MINUTES
INFO  [2024-01-12 18:02:55,755] com.commafeed.backend.task.ScheduledTask: registering task EntriesExceedingFeedCapacityCleanupTask for execution every 60 MINUTES, starting in 10 MINUTES
INFO  [2024-01-12 18:02:55,756] com.commafeed.backend.task.ScheduledTask: registering task OldEntriesCleanupTask for execution every 60 MINUTES, starting in 5 MINUTES
INFO  [2024-01-12 18:02:55,756] com.commafeed.backend.task.ScheduledTask: registering task OrphanedFeedsCleanupTask for execution every 60 MINUTES, starting in 20 MINUTES
INFO  [2024-01-12 18:02:55,756] com.commafeed.backend.task.ScheduledTask: registering task OrphanedContentsCleanupTask for execution every 60 MINUTES, starting in 25 MINUTES
INFO  [2024-01-12 18:02:55,756] com.commafeed.backend.task.ScheduledTask: registering task DemoAccountCleanupTask for execution every 1440 MINUTES, starting in 1 MINUTES
INFO  [2024-01-12 18:02:55,818] com.commafeed.backend.service.DatabaseStartupService: checking if database schema needs updating
INFO  [2024-01-12 18:02:55,990] com.commafeed.backend.service.DatabaseStartupService$1: Set default schema name to public
INFO  [2024-01-12 18:02:56,506] liquibase.changelog.StandardChangeLogHistoryService: Reading from public.databasechangelog
Database is up to date, no changesets to execute
INFO  [2024-01-12 18:02:56,727] liquibase.changelog.StandardChangeLogHistoryService: Reading from public.databasechangelog
INFO  [2024-01-12 18:02:56,792] liquibase.lockservice.StandardLockService: Successfully released change log
lock
INFO  [2024-01-12 18:02:56,797] liquibase.command.CommandScope: Command execution complete
INFO  [2024-01-12 18:02:56,800] com.commafeed.backend.service.DatabaseStartupService: database schema is up
to date

The API call to mark as read also returns 200

image

@Athou
Copy link
Owner

Athou commented Jan 12, 2024

Not sure why you don't get any errors but let's assume the issue is still the session. Could you try to stop the container of CommaFeed, delete all rows of the JettySessions table then start CommaFeed again?

@cdemi
Copy link
Author

cdemi commented Jan 13, 2024

I did as you said; stoped CommaFeed, dropped the JettySessions table and started CommaFeed again. Now I don't see the duplicate key error, I don't see any CommaFeed logs but the button still doesn't mark them all as read.

@cdemi
Copy link
Author

cdemi commented Jan 13, 2024

So, I just spun up a brand new instance of commafeed. New database etc... I added a feed and the problem still persists, using this configuration:

version: '3'
services:
 commafeed:
  image: athou/commafeed:latest
  container_name: commafeed
  restart: always
  networks:
   - web
   - default
  environment:
   - CF_DATABASE_DRIVERCLASS=org.postgresql.Driver
   - CF_DATABASE_URL=jdbc:postgresql://commafeeddb:5432/commafeed
   - CF_DATABASE_USER=commafeed
   - CF_DATABASE_PASSWORD=secret
   - TZ=Europe/Malta
   - CF_app_publicUrl=https://myurl/
   - CF_app_refreshIntervalMinutes=1
  labels:
   - "traefik.enable=true"
   - "traefik.http.routers.commafeed.rule=Host(`myurl`)"
   - "traefik.http.routers.commafeed.entrypoints=web-secure"
   - "traefik.http.routers.commafeed.tls.certresolver=le-dns"
  volumes:
   - ./data:/commafeed/data
 commafeeddb:
  image: postgres:16
  user: 1000:1000
  restart: always
  environment:
   - POSTGRES_DB=commafeed
   - POSTGRES_USER=commafeed
   - POSTGRES_PASSWORD=secret
  volumes:
   - ./postgressdata:/var/lib/postgresql/data

networks:
 web:
  external: true

@cdemi
Copy link
Author

cdemi commented Jan 13, 2024

Ok, sorry for the spam but I figured it out. It has something to do with timezones. On the commafeed container I have TZ=Europe/Malta. On a brand new installation without timezone configuration Mark all as Read works ok. If I add that timezone, Mark all as Read doesn't work.

I suspect something in 4.1.0 and TZ environment variable has changed

@Athou
Copy link
Owner

Athou commented Jan 13, 2024

On a brand new installation without timezone configuration Mark all as Read works ok. If I add that timezone, Mark all as Read doesn't work.

Oh that's why I could not reproduce the issue. Now that you mention it, I actually changed something related to dates in 4.1.0 but it should have been transparent. I think I need to change the column data types in the database from DATETIME to TIMESTAMP. I'll see what I can do, thank you!

EDIT: I can also reproduce the issue by changing the TZ of the database to America/Mexico_City.

@Athou
Copy link
Owner

Athou commented Jan 13, 2024

c4fbf98 should fix the issue, it will be part of the next release but you can already test it with the master docker tag if you'd like.

In the mean time, I guess a fix is to either remove the TZ env variable from the container or to set it to the same value on both containers :)

@Athou Athou added the bug label Jan 13, 2024
@cdemi
Copy link
Author

cdemi commented Jan 13, 2024

Thanks a lot for an awesome project!

@Athou Athou closed this as completed Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants