GET rest/bug_user_last_visit/<id> error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

GET rest/bug_user_last_visit/<id> error

Michael Cornelius
I'm trying to use this endpoint, but it seems just ... broken? My query looks like this:

curl -H "X-BUGZILLA-API-KEY: <secret>" http://bugzilla.domain.tld/rest/bug_user_last_visit/<some id>

"some id" is known to exist, and the API key is correct. (Other queries are working fine.)

My instance reponds with 200 OK, but the response contents are:

"{\"documentation\":\"https://bugzilla.readthedocs.org/en/5.0/api/\",\"error\":true,\"code\":100500,\"message\":\"Can't locate object method \\\"id\\\" via package \\\"43667\\\" (perhaps you forgot to load \\\"43667\\\"?) at Bugzilla/WebService/BugUserLastVisit.pm line 78.\\n\"}"

Is there a work-around, or something I might be doing wrong?

Thanks!
_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.
Reply | Threaded
Open this post in threaded view
|

Re: GET rest/bug_user_last_visit/<id> error

Michael Cornelius
Thanks for the reply, Thorsten.

Other API requests are working, such as getting bugs themselves and getting bug histories. I will around the GET requests though, and see if it makes a difference.

Also thanks for the Perl help. It's not a language I work with much.

On Tuesday, December 31, 2019 at 5:12:50 AM UTC-6, Thorsten Schöning wrote:

> Guten Tag Michael Cornelius,
> am Dienstag, 31. Dezember 2019 um 00:03 schrieben Sie:
>
> > Is there a work-around, or something I might be doing wrong?
>
> Are other requests to the API working? Because how you provide the
> API-key looks wrong to me, the docs are talking about providing those
> as part of the POST-body or GET query string, not as header.
>
> By testing other requests like a simple query to some bug you can test
> if your overall setup for the web server and stuff is properly.
>
> https://bugzilla.readthedocs.io/en/5.0/api/core/v1/bug.html#get-bug
>
> Besides that, the concrete problem you have indeed might be a bug:
>
> >    my %last_visit
> >      = map { $_->bug_id => $_->last_visit_ts } @{$user->last_visited($ids)};
> >    @last_visits
> >      = map { $self->_bug_user_last_visit_to_hash($_->id, $last_visit{$_}, $params) }
> >      @$ids;
>
> "$_->id" vs. "$last_visit{$_}" doesn't make much sense, try "$_" only
> for the first part. If that works, file a bug.
>
> https://www.bugzilla.org/developers/reporting_bugs.html
>
> If that doesn't change a thing, add the following before the quoted
> lines and have a look at your web server logs to see how params are
> availabel actually.
>
> > use Data::Dumper;
> > warn(Dumper($ids));
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning       E-Mail: [hidden email]
> AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
>
> Telefon...........05151-  9468- 55
> Fax...............05151-  9468- 88
> Mobil..............0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.
Reply | Threaded
Open this post in threaded view
|

Re: GET rest/bug_user_last_visit/<id> error

Michael Cornelius
In reply to this post by Michael Cornelius
Thanks for the reply, Thorsten.

Other requests are working, such as getting bugs and getting bug histories. I will change GET requests, though, to be compliant with the documentation and see what happens.

Thanks, also, for the help with Perl. It's not a language I'm familiar with.

On Tuesday, December 31, 2019 at 5:12:50 AM UTC-6, Thorsten Schöning wrote:

> Guten Tag Michael Cornelius,
> am Dienstag, 31. Dezember 2019 um 00:03 schrieben Sie:
>
> > Is there a work-around, or something I might be doing wrong?
>
> Are other requests to the API working? Because how you provide the
> API-key looks wrong to me, the docs are talking about providing those
> as part of the POST-body or GET query string, not as header.
>
> By testing other requests like a simple query to some bug you can test
> if your overall setup for the web server and stuff is properly.
>
> https://bugzilla.readthedocs.io/en/5.0/api/core/v1/bug.html#get-bug
>
> Besides that, the concrete problem you have indeed might be a bug:
>
> >    my %last_visit
> >      = map { $_->bug_id => $_->last_visit_ts } @{$user->last_visited($ids)};
> >    @last_visits
> >      = map { $self->_bug_user_last_visit_to_hash($_->id, $last_visit{$_}, $params) }
> >      @$ids;
>
> "$_->id" vs. "$last_visit{$_}" doesn't make much sense, try "$_" only
> for the first part. If that works, file a bug.
>
> https://www.bugzilla.org/developers/reporting_bugs.html
>
> If that doesn't change a thing, add the following before the quoted
> lines and have a look at your web server logs to see how params are
> availabel actually.
>
> > use Data::Dumper;
> > warn(Dumper($ids));
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning       E-Mail: [hidden email]
> AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
>
> Telefon...........05151-  9468- 55
> Fax...............05151-  9468- 88
> Mobil..............0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.
Reply | Threaded
Open this post in threaded view
|

Re: GET rest/bug_user_last_visit/<id> error

Michael Cornelius
Applying Thorsten's suggested change solved the problem. I filed a bug and attached the patch. Thanks again!
_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.