Closed Albert221 closed 7 years ago
I think this is already fixed and fix will be in rc2
I can confirm it's fixed :)
This still seems to be an issue. I am encountering it on v1.2.1. I cannot replicated on try.gitea.io though. It does not happen for new repositories created, after I've updated to 1.2.1, but actions on repos created prior to the upgrade, seems to be affected.
Some entries in the feed, are added 3 times, some 4 times. I cannot figure out why this is happening.
I'm unsure if this has anything to do with it. But I updated my Gitea instance from v1.1.3 to v1.2.1.
Maybe because duplicated hook scripts, you can rewrite hooks on admin panels if you have not customized them.
@lunny do you mean this Resync pre-receive, update and post-receive hooks of all repositories.
?
Yes.
That didn't help, unfortunately.
Here's a snippet from the log, that also shows, the action being inserted 3 times
2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, 12, 1, 15, 1985, false, "", true, "189|", 1508504709}
2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 12, 1, 15, 1985, false, "", true, "189|", 1508504709}
2017/10/20 15:05:09 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 12, 1, 15, 1985, false, "", true, "189|", 1508504709}
@jeppech check in repository settings that you don't have gitea git hook also in custom git-hook
I've deleted the custom hook, that I've been using for automating builds with Jenkins. The hook folders,pre-receive
, update
and post-receive
, only contain one hook file, which is the default Gitea hook that looks like the following:
$ cat update.d/gitea
#!/usr/bin/env bash
"/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3
Newly created repositories, on my Gitea instance, has the same default hooks (no duplicates or anything), as repositories created prior to v1.2.1.
@lafriks These are the available hooks, under Settings -> Git Hooks. No custom hooks have been added either.
@jeppech could you ls update.d/
to see if there are other hook files there.
@lunny here you go
Repository prior to v1.2.1
$ ls update.d
gitea
$ cat update.d/*
#!/usr/bin/env bash
"/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3
Repository created on v1.2.1
$ ls update.d
gitea
$ cat update.d/*
#!/usr/bin/env bash
"/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' update $1 $2 $3
Does any of you, got other suggestions, for fixing this?
@jeppech I can't reproduce that.
Can you point me in any other direction? Is it only the hooks, that can cause this to happen? Is there some settings, I could try and reset?
@lunny Could you tell me which piece of code, is responsible for inserting the activity in the database, and which part is triggering it. Then I'll try and tinker with it, my self.
Something that catches my eye, when scrubbing through the xorm logs, is the user_id's being inserted.
2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{1, 12, 1, 15, 2256, false, "", true, "194|", 1511268140}
2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 12, 1, 15, 2256, false, "", true, "194|", 1511268140}
2017/11/21 13:42:20 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 12, 1, 15, 2256, false, "", true, "194|", 1511268140}
The user triggering the action, is me (id=1). But somehow the users with id 3 and 5.
Here's another snippet, triggered by another user, this time it has 4 entries. User with id 5, triggered the action, but 3,13,14 are also shown.
2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{5, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690}
2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{13, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690}
2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{14, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690}
2017/11/21 15:14:50 [I] [SQL] INSERT INTO `action` (`user_id`,`op_type`,`act_user_id`,`repo_id`,`comment_id`,`is_deleted`,`ref_name`,`is_private`,`content`,`created_unix`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{3, 10, 5, 27, 2264, false, "", true, "41|New icons on nextcloud.", 1511273690}
@jeppech everyone who watch the project will receive a message.
@lunny It's just, that the numbers of insert statements, matches the number of duplicated items, in the activity feed. So I thought, that it might had something to do with, each other.
Now, I just tried commenting on a repository, with 2 watchers, but i still see 3 entries being inserted into the actions, again, which corresponds to the number of duplicate items, in my feed.
Have there been any changes, to watchers, prior to v1.2.1, that could course the number of duplicate items in the feed to equal with the number of watchers?
Actions seems to be inserted with different user IDs
According to lunny, that is expected. As an entry is added, for each user watching the repo. What about the statement, that retrieves the feed?
2017/11/28 09:29:25 [I] [SQL]
SELECT `id`, `user_id`, `op_type`, `act_user_id`, `repo_id`, `comment_id`, `is_deleted`, `ref_name`, `is_private`, `content`, `created_unix`
FROM `action`
WHERE (
user_id=? OR repo_id IN (
SELECT repo_id
FROM `access`
WHERE access.user_id = ?
)
)
AND is_deleted=?
ORDER BY `id`
DESC LIMIT 20
[]interface {}{1, 1, false}
Could this be getting different results, for repos created prior or after v1.2.1?
I'm happy to say, that my issues are gone, as of v1.3.0! Thank you! :)
@jeppech how did you resolve that?
To be honest, I have no idea. Just upgraded my Gitea instance 5 minutes ago, and all the doubled feeds are gone.
So I'm suspecting that either a query has changed, or some filtering in the templates. Haven't looked into it, so cannot say for sure.
And maybe you should upgrade to v1.3.1 since it fixed some bugs on v1.3.0.
I already did that too, thanks! :)
I am seeing the same problem - but with the latest Gitea (1.11.5).
[x]
):Description
I've got doubled the feed both in the dashboard and in the public activity. Almost everything is twice.
Screenshots