mattermost-plugin-gitlab icon indicating copy to clipboard operation
mattermost-plugin-gitlab copied to clipboard

Encountered an error getting your to do items

Open paulkitt opened this issue 4 years ago • 18 comments

After setting up the plugin everything works fine except the todo function. When calling /gitlab todo I get Encountered an error getting your to do items in the UI.

In the Mattermost log the plugin is throwing two errors almonst every minute:

  • {"level":"error","ts":1587731687.333412,"caller":"mlog/sugar.go:23","msg":"can't get todo in command","plugin_id":"com.github.manland.mattermost-plugin-gitlab","err":"can't list todo in GitLab api: json: cannot unmarshal string into Go struct field TodoTarget.target.id of type int"}
  • | {"level":"error","ts":1587731600.044075,"caller":"mlog/sugar.go:23","msg":"unable to list unreads in GitLab API","plugin_id":"com.github.manland.mattermost-plugin-gitlab","err":"can't list todo in GitLab api: json: cannot unmarshal string into Go struct field TodoTarget.target.id of type int"}

paulkitt avatar Apr 24 '20 12:04 paulkitt

We should improve logging all over the place for JSON unmarshaling failing.

levb avatar May 05 '20 13:05 levb

Any news? This is unresolved :-(

zawadaa avatar Sep 23 '22 12:09 zawadaa

Hi @zawadaa ,what MM/Gitlab versions are you using? Also, are you sure you see these exact messages flooding? Thanks.

catalintomai avatar Oct 03 '22 15:10 catalintomai

Hi! Yesterday I've updated my Gitlab installation (so MM is now 7.2.0) and works!! Thanks!!

zawadaa avatar Oct 04 '22 11:10 zawadaa

Hi @paulkitt , can you validate that it works and close the ticket if it indeed does? Thanks.

catalintomai avatar Oct 17 '22 15:10 catalintomai

@zawadaa Could you please tell me which version of gitlab you upgraded to?

pl7ofit avatar Oct 26 '23 09:10 pl7ofit

This was probably Gitlab https://about.gitlab.com/releases/2022/09/22/gitlab-15-4-released/ - check changelog.

zawadaa avatar Oct 26 '23 09:10 zawadaa

@zawadaa I'm using gitlab 15.11.13, mm 7.10.0 and plugin version 1.7.0 but the problem is still there, it's so weird =\

pl7ofit avatar Oct 26 '23 10:10 pl7ofit

SOA#1 Gitlab 16.4.1 and MM 8.1.2.

zawadaa avatar Oct 26 '23 10:10 zawadaa

@DHaussermann, @levb, @mickmister, @manland we were experimenting with the plugin at my workplace and encountered this issue as well. After digging into the code and dependencies (more precisely go-gitlab), I found that this comes from the issue described here https://github.com/xanzy/go-gitlab/issues/1743

To summarize, gitlab is supposed to return an int id for targets of todos but instead returns a commit sha as a string when the target is a commit (it happens when your todo item is a comment on a commit for example).

The team at go-gitlab fixed the problem by putting a workaround while Gitlab still has the issue open (see https://gitlab.com/gitlab-org/gitlab/-/issues/416180). But they introduced a typo which needs to be fixed (see https://github.com/xanzy/go-gitlab/pull/1744#issuecomment-1917573203).

I see that the latest release of the mattermost plugin stil uses the version 0.55.0 of go-gitlab.

Can you update to the latest version (now it 0.96.0 but still has the problem) once they fix the typo?

And to all the commenters above, you are seeing that sometimes it works and sometimes not because it happens only when you receive a comment in Gitlab from someone who wrote it on a commit (see my test here)

aelgasser avatar Jan 30 '24 17:01 aelgasser

Hi @aelgasser, thanks so much for this thorough explanation. We can certainly ship a fix with the latest go-gitlab version once this is fixed in that library. Thanks again for the full context and resolution here :+1: cc @hanzei

mickmister avatar Jan 30 '24 19:01 mickmister

Hi @mickmister the issue has just been fixed in go-gitlab in their 0.97.0 release (https://github.com/xanzy/go-gitlab/pull/1744#issuecomment-1925326400, https://github.com/xanzy/go-gitlab/releases/tag/v0.97.0)

aelgasser avatar Feb 03 '24 14:02 aelgasser

Thanks @aelgasser, we're queuing this change for the next release :+1:

Thanks again for your help here!

mickmister avatar Feb 06 '24 01:02 mickmister

Thank you @mickmister Do you have an approximate timeline for the next release? I know it's been about 4 years for other people waiting in this discussion and only about 1 week for me, but we are evaluating ways to streamline our workflows with Mattermost and would love to keep the momentum.

Best

aelgasser avatar Feb 06 '24 17:02 aelgasser

Hi @aelgasser, we have a release in process and are including this fix in the release. I'm thinking this will be released next week. I'll keep you updated. Thanks again

mickmister avatar Feb 07 '24 02:02 mickmister

Hi @mickmister, I see you released version 1.8.1 with the fix thank you! Although we don't see it on the Mattermost plugin marketplace (https://mattermost.com/marketplace/gitlab-plugin/) or at least when we try to update from our version 1.8.0, Mattermost doesn't find any newer version. Is there another step before updating this marketplace?

I don't know if it's the proper channel, but may I suggest adding the current version number to the plugin page in the marketplace (on the right sidebar along with the author and categories for example)?

image

Best, Abdel

aelgasser avatar Mar 01 '24 07:03 aelgasser

@aelgasser Apologies, this actually did not get into the 1.8.1 release. We are wrapping up last changes for 1.9.0 though, and will have it out as soon as it's been validated and tested.

Version 1.8.1 should be showing in the in-product marketplace though. Is this not what you see?

image

mickmister avatar Mar 01 '24 17:03 mickmister

@mickmister found version 1.8.1 and now waiting patiently for 1.9.0 then :)

aelgasser avatar Mar 19 '24 21:03 aelgasser