GET rest/bug_user_last_visit/<id> error

I'm trying to use this endpoint, but it seems just ... broken? My query loo=
ks 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/\",\"erro=
r\":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!
0
Michael
12/30/2019 11:03:43 PM
mozilla.support.bugzilla 10108 articles. 0 followers. Post Follow

4 Replies
24 Views

Similar Articles

[PageSpeed] 27

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
>      =3D map { $_->bug_id =3D> $_->last_visit_ts } @{$user->last_visited(=
$ids)};
>    @last_visits
>      =3D 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=FC=DFen,

Thorsten Sch=F6ning

--=20
Thorsten Sch=F6ning       E-Mail: Thorsten.Schoening@AM-SoFT.de
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=E4ftsf=FChrer: Andreas Muchow

0
windows
12/31/2019 11:12:36 AM
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=C3=B6ning w=
rote:
> Guten Tag Michael Cornelius,
> am Dienstag, 31. Dezember 2019 um 00:03 schrieben Sie:
>=20
> > Is there a work-around, or something I might be doing wrong?
>=20
> 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.
>=20
> 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.
>=20
> https://bugzilla.readthedocs.io/en/5.0/api/core/v1/bug.html#get-bug
>=20
> Besides that, the concrete problem you have indeed might be a bug:
>=20
> >    my %last_visit
> >      =3D map { $_->bug_id =3D> $_->last_visit_ts } @{$user->last_visite=
d($ids)};
> >    @last_visits
> >      =3D map { $self->_bug_user_last_visit_to_hash($_->id, $last_visit{=
$_}, $params) }
> >      @$ids;
>=20
> "$_->id" vs. "$last_visit{$_}" doesn't make much sense, try "$_" only
> for the first part. If that works, file a bug.
>=20
> https://www.bugzilla.org/developers/reporting_bugs.html
>=20
> 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.
>=20
> > use Data::Dumper;
> > warn(Dumper($ids));
>=20
> Mit freundlichen Gr=C3=BC=C3=9Fen,
>=20
> Thorsten Sch=C3=B6ning
>=20
> --=20
> Thorsten Sch=C3=B6ning       E-Mail: Thorsten.Schoening@AM-SoFT.de
> AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
>=20
> Telefon...........05151-  9468- 55
> Fax...............05151-  9468- 88
> Mobil..............0178-8 9468- 04
>=20
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Gesch=C3=A4ftsf=C3=BChrer: Andreas Muchow

0
Michael
12/31/2019 2:40:38 PM
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=C3=B6ning w=
rote:
> Guten Tag Michael Cornelius,
> am Dienstag, 31. Dezember 2019 um 00:03 schrieben Sie:
>=20
> > Is there a work-around, or something I might be doing wrong?
>=20
> 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.
>=20
> 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.
>=20
> https://bugzilla.readthedocs.io/en/5.0/api/core/v1/bug.html#get-bug
>=20
> Besides that, the concrete problem you have indeed might be a bug:
>=20
> >    my %last_visit
> >      =3D map { $_->bug_id =3D> $_->last_visit_ts } @{$user->last_visite=
d($ids)};
> >    @last_visits
> >      =3D map { $self->_bug_user_last_visit_to_hash($_->id, $last_visit{=
$_}, $params) }
> >      @$ids;
>=20
> "$_->id" vs. "$last_visit{$_}" doesn't make much sense, try "$_" only
> for the first part. If that works, file a bug.
>=20
> https://www.bugzilla.org/developers/reporting_bugs.html
>=20
> 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.
>=20
> > use Data::Dumper;
> > warn(Dumper($ids));
>=20
> Mit freundlichen Gr=C3=BC=C3=9Fen,
>=20
> Thorsten Sch=C3=B6ning
>=20
> --=20
> Thorsten Sch=C3=B6ning       E-Mail: Thorsten.Schoening@AM-SoFT.de
> AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
>=20
> Telefon...........05151-  9468- 55
> Fax...............05151-  9468- 88
> Mobil..............0178-8 9468- 04
>=20
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Gesch=C3=A4ftsf=C3=BChrer: Andreas Muchow

0
Michael
12/31/2019 2:42:57 PM
Applying Thorsten's suggested change solved the problem. I filed a bug and attached the patch. Thanks again!
0
Michael
12/31/2019 4:06:47 PM
Reply: