Deployment script makes the committed files go blank

Issue #17 resolved
Nishad Kanade created an issue

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)

  1. Alexandru Lixandru repo owner

    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.

  2. Nishad Kanade 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?

  3. none none

    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.

  4. Nishad Kanade 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.

  5. Alexandru Lixandru repo owner

    Thanks both of you for the valuable feedback. Seems like API-related. Looking into it.

  6. Anton Iskandiarov

    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.

  7. Anton Iskandiarov

    Please take a look at my previous comment, just updated it with some useful (I hope) details.

  8. Alexandru Lixandru 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?

  9. Eric Draken

    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.

  10. Ben Francis

    We are experiencing the same thing - initially, it worked fine - then it was sporadic - now it is happening with each commit.

  11. Benoit Lapointe

    Same issue here, For every file modified, It updates it as empty every time. Started yesterday evening (wednesday october 15)

  12. Benoit Lapointe

    FYI : After debugging the calls of curl, this error is returned :

    error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure

  13. Alexandru Lixandru 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...

  14. Alexandru Lixandru 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.

  15. Alexandru Lixandru repo owner

    Well, I think so. BitBucket's HTTPS connections now work only over TLSv1; most likely BitBucket staff disabled SSLv3 support on purpose.

  16. Benoit Lapointe

    Being advised before hand would've been fun from bitbucket !! Happy all is working well now. :)

  17. Log in to comment