Deployment script makes the committed files go blank
Hello Alixandru,
Thank you for the awesome script.
I have been using the script for over two months now. Everything was fine till today, when the committed files would become blank on my development server. Though i can see the proper versions of files in my bitbucket repo. Can you please help me track the issue?
Comments (34)
-
repo owner -
reporter I really appreciate the quick response. Thanks a ton for that.
Actually its started behaving in such manner since today. It is happening on all the projects which are on the same server. All of them have been deployed using your marvelous script.
I tried to a deploy again the entire code, but it gives me this response "Unable to find the extracted files in commits/". I also tried to get in touch with the server admin, if they have made any user group changes that is causing the errors. I also checked the permissions for the commits folder , it is 777.
Do you have any idea of the possible reason?
-
Hi, that's really weird, I've just started experiencing exactly the same issue for the couple of commits I've made today.
For example I update a file on my local machine called shared.css and commit this.
The expected behaviour is that the file gets committed to bitbucket and then the bitbucket hook calls bitbucket sync to update the contents of shared.css on the live server.
For the last two commits i've made however the commit proceeds correctly and the contents of the new commit can be seen on bitbucket, however when i look at the live server the file itself is there (shared.css) but the contents are blank.
-
reporter I believe there must be some parameter changes that Bitbucket sends to the deploy script or may be some Bitbucket API changes causing the issue. I will try if i can find anything regarding the change. Would be good if we can find the solution soon.
-
repo owner Thanks both of you for the valuable feedback. Seems like API-related. Looking into it.
-
Hi guys,
same issue for me, happens since today.
I tried to redeploy entire repository, but it return:
BitBucket Sync - Full Deploy ============================ * Fetching archive from https://bitbucket.org/***myteam***/get/master.zip * Extracting archive to commits/ # Unable to find the extracted files in commits/
after some investigation I discovered that line
$result = getFileContents($baseUrl . $repoUrl . $branchUrl, $zipLocation . $zipFile);
returns null, file can't be fetched. Direct link works just fine if I'm trying to get file directly in browser.
-
repo owner Hm, at first sight, API is fine. And there are no listed changes.
https://bitbucket.org/api/1.0/repositories/alixandru/bitbucket-sync/raw/master/index.php https://snap.apigee.com/1EXAM9T
Could it be that your server is not allowed to make external calls to bitbucket's site?
-
repo owner OK, so this could not be related to hosting...
-
Please take a look at my previous comment, just updated it with some useful (I hope) details.
-
I'm using this url for deployment http://myhost.com/bitbucket-sync/deploy.php?setup=repository&team=team
-
wget directly from server works perfect
-
repo owner Oh, sorry Anton, I overlooked your comment. Will look into it. Thanks!
-
repo owner I could not find anything yet. It must be something with curl. Can any of you tell me what version of cURL you have on your server?
-
Chiming in here too, using cURL version 7.19.7, but this hasn't changed in months, and like Nishad I am observing the same results.
-
We are experiencing the same thing - initially, it worked fine - then it was sporadic - now it is happening with each commit.
-
Same results here.
-
I have the same problem
-
also curl 7.19.7. don't think this has changed in a while tho.
-
We have the same problem. Files goes blank after upload. Curl Version 7.26.0
-
Same issue here, For every file modified, It updates it as empty every time. Started yesterday evening (wednesday october 15)
-
Also curl version installed is : 7.38.0
-
FYI : After debugging the calls of curl, this error is returned :
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
-
@alixandru I have submitted a pull request to fix the issue
-
repo owner OK, this is related to cURL and/or BitBucket's certificate. The error message returned by curl is
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
Still debugging this... -
@alixandru save yourself some time, look at my pull request. It fixes the issue
-
repo owner - changed status to resolved
Fixes issue
#17. Removed the SSL version of Curl, leaving it at the default. Default is checking for best version.→ <<cset b6c44b704b0e>>
-
repo owner Merged in triben/bitbucket-sync-1/triben/fixes-issue-17-removed-the-ssl-version-o-1413401138745 (pull request #7)
Fixes issue
#17. Removed the SSL version of Curl, leaving it at the default. Default is checking for best version.→ <<cset cb3a29612e38>>
-
repo owner Cool @triben ! Thanks for this fix. I didn't see your comments until now (had the issues page opened without refreshing it when I posted my comment). Indeed, your pull request fixes the problem. Thank you for taking the time to look into it, and thanks everybody else for reporting this.
-
Awesome! Thanks for all your work on this @triben and @alixandru!
-
I wonder if this is why SSLv3 stopped working? http://googleonlinesecurity.blogspot.co.uk/2014/10/this-poodle-bites-exploiting-ssl-30.html
-
repo owner Well, I think so. BitBucket's HTTPS connections now work only over TLSv1; most likely BitBucket staff disabled SSLv3 support on purpose.
-
repo owner And here is the confirmation: http://blog.bitbucket.org/2014/10/15/poodle-and-the-end-of-ssl-3-0-on-bitbucket/
-
reporter Thank you @alixandru and @triben for your time and efforts. The fix works fine.
-
Being advised before hand would've been fun from bitbucket !! Happy all is working well now. :)
- Log in to comment
Does this happen for all deployed files or is it rather sporadic? And, can you tell me if the files are really blank or they contain any text (like "Not found")? For some reason, the BitBucket API sometimes returns a "Not found", even if the files exists in the repository and are accessible, but this situation is covered in the code (see here https://bitbucket.org/alixandru/bitbucket-sync/src/e80189cac63b188fbca9a8c8a26bfddff73e5173/deploy.php?at=master#cl-329). It might be something similar to this situation.