Automatic publishing not working



2 years ago
2 years ago


(Reporter: ted, Assigned: smacleod)



MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Error loading review requests:


(1 attachment)



2 years ago
I've gotten this reliably for every review I've pushed recently:

$ hg push review -c 59ef1903d9b8
pushing to ssh://
searching for changes
remote: adding changesets                                                                             
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 1 changes to 5 files (+1 heads)
remote: Trying to insert into pushlog.
remote: Inserted into the pushlog db successfully.
submitting 1 changesets for review

changeset:  272100:59ef1903d9b8
summary:    bug 1182519 - Put mozconfigs for cross-mac builds in tree. r?mshal
review: (draft)

review id:  bz://1182519/ted
review url: (draft)

publish this review request now (Yn)? 
remote: WARNING:root:There was an error while creating a cookie file: [Errno 13] Permission denied: '/.rbtools-cookies'
error publishing review request 13305: You are not logged in (HTTP 401, API Error 103)
(review requests not published; visit review url to attempt publishing there)
Likewise. I'm told the problem will be solved by bug 993233.
Also, a workaround is to explicitly put your BMO credentials in your .hgrc file, as described here:

Comment 3

2 years ago
Yes, this is a side effect of using cookies for auth. API tokens will eventually replace username/password and cookie auth in the client.


2 years ago
Assignee: nobody → gps
Priority: -- → P1

Comment 4

2 years ago
Let's look into upgrading rbtools and see if that fixes it.
Assignee: gps → smacleod

Comment 5

2 years ago
Created attachment 8637267 [details]
MozReview Request: mozreview: start passing cookie authentication when auto publishing (Bug 1184079). r?gps

mozreview: start passing cookie authentication when auto publishing (Bug 1184079). r?gps

We were not using provided cookie credentials to authenticate with
Review Board when automatically publishing review requests on push. We
now use these credentials if they are provided.

Also, we use the RBClient context manager from reviewboardmods.pushhooks
to avoid issues with the RBTools cache and cookie files that we hit with
the RBTools version we are using. Once we are able to upgrade to a
newer version of RBTools we should be able to remove the hacks here as
Attachment #8637267 - Flags: review?(gps)

Comment 6

2 years ago

::: hgext/reviewboard/hgrb/
(Diff revision 1)
> -    for k, v in o['other']:
> +        for k, v in o['other']:
> -        if k != 'reviewid':
> +            if k != 'reviewid':
> -            continue
> +                continue
> -        rrid = urllib.unquote(v)
> +            rrid = urllib.unquote(v)
> -        try:
> +            try:
> -            rr = root.get_review_request(review_request_id=rrid)
> +                rr = root.get_review_request(review_request_id=rrid)
> -            draft = rr.get_draft()
> +                draft = rr.get_draft()
> -            draft.update(public=True)
> +                draft.update(public=True)
> -            lines.append('success %s' % rrid)
> +                lines.append('success %s' % rrid)
> -        except APIError as e:
> +            except APIError as e:
> -            lines.append('error %s %s' % (rrid, str(e)))
> +                lines.append('error %s %s' % (rrid, str(e)))

I love indentation markers :)

Comment 7

2 years ago
Comment on attachment 8637267 [details]
MozReview Request: mozreview: start passing cookie authentication when auto publishing (Bug 1184079). r?gps

::: hgext/reviewboard/
(Diff revision 1)
> +                           username=None, password=None, userid=None,
> +                           cookie=None) as client:

Do these arguments not default to None?
Attachment #8637267 - Flags: review?(gps) → review+

Comment 8

2 years ago

> Do these arguments not default to None?

They do not. I've fixed them so that they do though, and changed this call.

Comment 9

2 years ago
Should be fixed after deploy of

Comment 10

2 years ago
This has been deployed for a few days and appears to be fixed - please reopen and provide the error message if this fails for you still.
Last Resolved: 2 years ago
Resolution: --- → FIXED


2 years ago
Duplicate of this bug: 1181886
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.