Attachment file from Git only got synced if it was from master branch

Issue #25 resolved
Jerry Wang created an issue

Tested Confluence version: 5.4.1 Tested Git for Confluence version: 1.9.3 (100 users paid license)

Steps to reproduce the issue: 1. add a git attachment to the page, and choose the file from an non-master branch. 2. made a content change to the file, and commit/push the change to the remote repo. 3. wait for the sync job completed. 4. check the attachment version history, and download the attachment file. And you will still see the original version. And only one version in the attachment history. 5. add another git attachment to the same page, and choose the file from the master branch of the same repo. 6. repeat the step 2,3 and 4, you should see two versions for the 2nd attachment.

Also noticed in the confluence-home directory, the local repo is on the master branch by default inside the avisi-git-plugin-repositories directory.

Comments (15)

  1. Mitchel Kuijpers

    Hi @je2ryw

    Sorry to hear it isn't working for you.

    The reason you only see the master branch in confluence-home repo is because you don't have to checkout any other branch to get to the files from other branches. If you do a clone of a repo it will download the master branch and all other branches on your filesystem. And those are accessible without a checkout to a different branch. I am going to try to reproduce your issue and I will get back to you.

  2. Mitchel Kuijpers

    We found the issue and you are correct, we are working on fixing it and we will be pushing an update as soon as possible. I'll keep you posted @je2ryw

  3. Jerry Wang reporter

    Confirmed working with new 1.9.4 release, however, after upgrade, the Git repo needs to be re-added in the plugin configuration. Also, noticed multiple duplicated repos been created in the plugin configuration (repo list), and I also cannot remove the duplicated repo. Clicked on the remove button, but nothing happens.

  4. Tomas Theunissen

    Sorry for the inconvenience that the new issues cause. It would help us if you could answer the following questions;

    • Did you have to re-add the repo because it was not showing anymore?
    • Are all repositories duplicated, or only some?
    • Do you see any errors in the log when trying to delete the duplicated repositories?
  5. Jerry Wang reporter
    • After upgrade, I did remove the old attachment from the page, and when I was trying to add the same file (from non-master branch) again, I can navigate through the branch directory tree, but got error "File not added. Sorry, the Git for Confluence add-on could not find the file "README.md", are you sure it exists in the repository?" after click the "Add attachment" button.
    • Then I went to Git repo configuration page, try to delete the repo, and re-add it again. The repo delete did not work, so I just added the same repo again. Then multiple duplicated entries showed up for the same repo. I think the multiple duplicated entries of the same repo was caused by I entered the repo list page multiple times while the repo was still in the clone process with inline progress update. (I clicked the "back" and the GIt server multiple times)
    • Exceptions/Errors from the atlassian-confluence.log attached.
    • First error shows there were still multiple attachments referred to the repo, so I cannot delete it.
    • After I deleted all related attachments, I was getting a different NPE. Also confirmed the "62" repo directory did exist inside the "avisi-git-plugin-repositories" directory.
  6. Tomas Theunissen

    The NPE you get is really weird, if I check the code it can only be caused when there is a repository without a server.

    Were you able to get rid of the duplicate repositories in the end (despite the errors)?

  7. Jerry Wang reporter

    Nope, because of the NPE, I can't delete any repositories in the end. And in the confluence database, the data rows in both repository and server tables look fine.

    mysql> select * from AO_353E89_REPOSITORY; +----+---------------------+------------------------------------------------+------------------------------------------------+-----------+ | ID | LAST_SYNCHRONIZED | NAME | PATH | SERVER_ID | +----+---------------------+------------------------------------------------+------------------------------------------------+-----------+ | 67 | 2015-01-09 23:35:06 | /product/platform | /product/platform | 4 | | 68 | 2015-01-09 23:35:07 | /product/platform | /product/platform | 4 | | 69 | 2015-01-09 23:35:07 | /product/platform | /product/platform | 4 | | 70 | 2015-01-09 23:35:08 | /product/platform | /product/platform | 4 | +----+---------------------+------------------------------------------------+------------------------------------------------+-----------+

    mysql> select * from AO_353E89_SERVER; +-----------------------+---------------------+----------------+----+-----------+----------+------+------------------------------+----------+ | AUTHENTICATION_METHOD | CONNECTION_PROTOCOL | HOST | ID | NAME | PASSWORD | PORT | SSH_KEY | USERNAME | +-----------------------+---------------------+----------------+----+-----------+----------+------+------------------------------+----------+ | NO_AUTHENTICATION | HTTPS | github.com | 1 | GitHub | NULL | NULL | NULL | NULL | | NO_AUTHENTICATION | HTTPS | bitbucket.org | 2 | Bitbucket | NULL | NULL | NULL | NULL | | SELECT_PRIVATE_KEY | SSH | xxx.xxx.xxx.xxx | 4 | SCM | | NULL | /home/uxp/.ssh/build_rsa.txt | git | +-----------------------+---------------------+----------------+----+-----------+----------+------+------------------------------+----------+

  8. Mitchel Kuijpers

    We found the root cause of the nullpointer issue and looking into it now, we will get back to you as soon as we have an update ready.

  9. Mitchel Kuijpers

    @je2ryw

    We found the bug and fixed it you can find it in the new release (1.9.5) this will fix your deletion issue.

    Please let us know if it fixes it for you and if it does you may close this issue if you like :)

  10. Log in to comment