I'm trying the following ColdFusion code in order for our server to periodically download a zip archive of our repo for an executive backup request. Here's the basic code so far (an amalgam based on a lot of StackOverflow solutions I've found):
<cfset user = urlEncodedFormat("[my username]") />
<cfset pass = urlEncodedFormat("[redacted]") />
After about 10 seconds, the server records the following response:
Header HTTP/1.1 400 Bad Request Server: nginx Content-Type: text/html Strict-Transport-Security: max-age=31536000; includeSubDomains; preload Date: Tue, 01 Oct 2019 02:26:47 GMT Connection: close Content-Length: 163
Date Tue, 01 Oct 2019 02:26:47 GMT
Explanation Bad Request
Strict-Transport-Security max-age=31536000; includeSubDomains; preload
Statuscode 400 Bad Request
The contents of the downloaded "repo.zip" file is the following:
Request Line is too large (4233 > 4094)
I've tried changing the url attribute so it begins with "https://#user#:#email@example.com" and there's no result until a security block is applied.
The CFML server is not running a Git daemon, and is hosted in a HIPAA compliant location.
Are all of these StackOverflow solutions out of date? Is there a basic problem or misunderstanding with this code, or another solution I can use - which does not involve a large installation for such a simple task?
Hello @Alan Holden,
Bitbucket returns this error when the URL is too large, specifically when takes more than 4094 bytes, which effectively means roughly the same number of characters. That's quite a large value. Can you check what exact URL is being fetched by that CFML script? Specifically, does the branch in your script come from some variable which might contain wrong value?
I assume you get the response in a zip because CF packs the response into specified file no matter what response it got. Normally Bitbucket just shows an HTML page: example link (note how huge the URL should be to hit this error).
Hope this helps.
Thanks @Daniil Penkin
I appreciate the swift response.
The url was altered only for this post. It is a static string otherwise, and is only 59 characters long. For example, the [branch] is simply 'development'.
You are correct that this CF tag puts the response into the file that I specify. Otherwise it would be contained in a cffile.fileContent element, but essentially the same.
The problem seemed to be in my URL encoding those user and pass variables prior to the request tag. My guess is that <cffile> is probably already encoding those, and further encoding that result may have created some long strings (although I would not have expected the final result to become THAT long!).
Here is the correct usage:
Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster ! While we’re all excited about the new improvements to Bitbucket ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events