Fwd: rboard delete attachment is giving this error. Do you what can be done?

18 views
Skip to first unread message

geeta subramanian

unread,
Jan 7, 2021, 9:35:02 AM1/7/21
to revie...@googlegroups.com
Hi,

Issue:
Same new file is getting attached again & again. Delete attachment api is giving error.


Error:
Delete attachment request: [http://codereview.commvault.com/api/review-requests/98735/file-attachments/58255/]
2021-01-07 09:24:25 649968   ERROR   : Unable to connect to review board site for form [114203 (1100080)] with error while doing delete attachment. [HTTP Error 301: Moved Permanently]


Code:

currentAttachmentId = dAttachment['id'#get id from the 'file_attachments' json part
                    #Delete each req: /api/review-requests/{review_request_id}/file-attachments/{file_attachment_id}/
                    sDeleteAttachmentUrlc = ("%sreview-requests/" % sRboardBaseurl) +sReviewRequestId+"/file-attachments/"+str(currentAttachmentId)+'/'
                    umslogger.writeError("Delete attachment request: [%s]" % sDeleteAttachmentUrlc)
                    oRequest = urllib2.Request(sDeleteAttachmentUrlc)
                    oRequest.add_header("Authorization""Basic %s" % sLoginAuthorize)
                    oRequest.get_method = lambda'DELETE'
                    try:
                        urllib2.urlopen(oRequest, timeout=15# Delete will happen here, but a publish is needed.
                    except Exception as err:
                        #We want to catch and log. Any error doesnt matter, we will still continue with attach
                        umslogger.writeError("Unable to connect to review board site for form [%d (%d)] with error while doing delete attachment. [%s]" % (gnFormID, gnBuildID, str(err)))
            

Christian Hammond

unread,
Jan 7, 2021, 6:34:15 PM1/7/21
to revie...@googlegroups.com
It's trying to redirect you. Can you see what the result is of the 'Location' header?

Is this meant to be http:// or https:// ?

Christian

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/CAASHijqRyu5u9an8MDx4Y5X5zLRdjGBezSVNH84ru0Frd7-Lcg%40mail.gmail.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

geeta subramanian

unread,
Jan 7, 2021, 7:10:35 PM1/7/21
to revie...@googlegroups.com
Thank you for the reply, Chris!
Yes, it was changed to https


-Geeta



Reply all
Reply to author
Forward
0 new messages