-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to provision using archivematica playbook with vars-singlenode-qa.yml (on Windows) #40
Comments
Here's the output from git after I try /usr/bin/git checkout --track -b qa/0.x origin/qa/0.x by hand: vagrant@am-local:/vagrant/src/archivematica-storage-service$ git status Changes not staged for commit:
no changes added to commit (use "git add" and/or "git commit -a") -- vagrant@am-local:/vagrant/src/archivematica-storage-service$ ls -l storage_service/static/js/vendor/base64.js -- vagrant@am-local:/vagrant/src/archivematica-storage-service$ ls ../../../external/base64-helpers/base64-helpers.js -- vagrant@am-local:/vagrant/src/archivematica-storage-service$ ls -l osdeps -- I'm guessing that maybe this is the Windows symlink issue raising its head again... even though in the case of "osdeps", the symlinks have been created successfully... |
If I look at it using Git Bash, everything looks OK. It's only when I go into the VM that I see those differences and even using "git checkout -- " won't get rid of them. |
Looks like the ../../../external/base64-helpers/base64-helpers.js might be submodule? I'm going to try stable again..... |
Using vars-singlenode-1.6.yml, and I'm still in the process of provisioning, but the archivematica-storage-service seems to have been installed correctly. Here's the view from Windows: $ ls -l $ ls -l storage_service/static/js/vendor/base64.js Going to see if I can vagrant ssh in during provisioning... vagrant@am-local:/vagrant/src/archivematica-storage-service$ git status Changes not staged for commit:
I'm seeing the same thing as last time... however git didn't fail when using vars-singlenode-1.6.yml for the archivematica-storage-service... |
Hmm I notice that core.symlinks isn't set on the VM-side whereas I do have it set on the Windows side. I might experiment with that for a moment... |
Hmm doesn't seem to make a difference at a glance. |
I imagine this doesn't affect vars-singlenode-1.6.yml because git doesn't need to switch branches since the git repositories use the stable branches as the repository HEAD. |
Because everything looks OK on Windows, I'm wondering if this is actually a vboxfs issue? |
I noticed the Ansible command was "/usr/bin/git checkout --track -b qa/0.x origin/qa/0.x" which doesn't mention force... so I just tried the following in "archivematica": "git checkout --force qa/1.x" And that worked. The "git status" output has changed from: |
to:
|
@sevein mentioned that qa/1.x moved fpr out of a submodule and instead gets fpr using pip so that makes sense that it's gone. I imagine the others stayed the same across versions. And they're only showing up as modified because vboxsf or at least vboxsf on Windows is maybe cloning them as a file with the symlink target as its content before creating the symlinks? I don't know enough about Git internals to know exactly what's going on here... |
So I just tried the following: cd /vagrant At the end of a git diff, I see this: diff --git a/test b/test |
Looks like someone else noted this years ago: I'm thinking it must be something like... it gets cloned into the shared folder as a file containing text to the target, and then underneath Virtualbox Windows is creating a symlink after Git has already recorded it as a regular file? Of course, it's not an issue on Windows. Git seems to work correctly there. On Windows, I'm using git version 2.13.2.windows.1. Whereas in Virtualbox, I'm using git version 1.9.1. Using the following to install a newer version of git: Now I'm using git version 2.13.0 on Virtualbox guest... Still a problem. -- Using "git update-index --assume-unchanged" might be an option, but not really in this case... |
"Support for symbolic links across synced folder implementations and host/guest combinations is not consistent. Vagrant does its best to make sure symbolic links work by configuring various hypervisors (such as VirtualBox), but some host/guest combinations still do not work properly. This can affect some development environments that rely on symbolic links. The recommendation is to make sure to test symbolic links on all the host/guest combinations you sync folders on if this is important to you." https://www.vagrantup.com/docs/synced-folders/basic_usage.html But the symlinks do work... it's just git which is having an issue with it... |
Tried the "git update-index --assume-unchanged" with mixed results. It mostly just acts to confuse git (and you). |
So this is a problem... and it looks like it's probably due to having Windows as the host and Linux as the guest. While the symlinks do work, there's some issue with how they're created and how Git records their creation I guess. I'm not sure. As for the actual problem I'm having... I think it's just that Ansible isn't having Git force the checkout despite the use of "force: yes" in the Ansible playbook. This seems to be reported by others as well: ansible/ansible#19809 |
Looks like a bug in the "git" module in Ansible. I've highlighted it on that Ansible issue, but basically it looks like it ignores the "force" parameter because it's trying to check out a remote branch instead of a local branch. |
Because I'm stubborn, I'm going to try to work around this... I've gone into src/archivematica and src/archivematica-storage-service and manually created local branches for qa/1.x and qa/0.x respectively. I'm guessing that will work... because that should avoid the "force" bug in Ansible. |
Waiting for Ansible to run... I see that other people have had issues with symlinks in other contexts: https://discuss.atom.io/t/atom-on-windows-incorrectly-showing-files-as-modified-git/12805/13 Hmm... the issue at https://www.bountysource.com/issues/39638459-lfs-tracked-files-are-sometimes-incorrectly-shown-as-modified-in-git-status-output has me thinking... if the issue is with the index... maybe there's something we can do. Still reading through this link though. |
Note that my workaround of manually checking out qa/1.x and qa/0.x into src/archivematica and src/archivematica-storage-service worked... However I encountered a different error during "vagrant provision": TASK [artefactual.archivematica-src : Run SS django collectstatic] ************* When I prettify that a bit, it looks like it's a configuration issue? So I'm guessing a problem with the qa/0.x branch? |
If someone could on a non-Windows system could run deploy-pub using vars-singlenode-qa.yml, we might see if it is a more widespread problem there. |
As for the git issue... vagrant@am-local:/vagrant/src/archivematica-storage-service$ git ls-tree HEAD osdeps/Ubuntu-16.json vagrant@am-local:/vagrant/src/archivematica-storage-service$ git cat-file -p ab357c396a99f5381083bd12666da5d464939a32 vagrant@am-local:/vagrant/src/archivematica-storage-service$ git show HEAD:osdeps/Ubuntu-16.json vagrant@am-local:/vagrant/src/archivematica-storage-service$ cat osdeps/Ubuntu-16.json vagrant@am-local:/vagrant/src/archivematica-storage-service$ git diff osdeps/Ubuntu-16.json -- Interestingly, on Linux, I see some of the same stuff in git: But it doesn't show up as modified in "git status". But yeah... that's a level of git beyond my current understanding. |
I've removed archivematica_src_dir from the Vagrantfile so I'm using /opt/archivematica instead of /vagrant/src to avoid the issues with Ansible's buggy git module and Git's buggy handling of symlinks for a Windows host/Linux guest Virtualbox shared folder. However, I'm still running into this problem, so I'm thinking that there's an issue with archivematica-storage-service's qa/0.x branch. TASK [artefactual.archivematica-src : Run SS django collectstatic] ************* |
I'm getting the same error in Linux. It looks like a new env var is required (in production?) after artefactual/archivematica-storage-service@8934b22 |
The following PR should fix the error in TASK [artefactual.archivematica-src : Run SS django collectstatic] |
Then I'm getting the following error:
Which looks to be related to artefactual/archivematica@5d1e512 |
@jraddaoui those errors are resolved in artefactual-labs/ansible-archivematica-src#123 which just got merged |
Thanks @jhsimpson ! |
I've tried to provision a few times now using vars-singlenode-qa.yml instead of vars-singlenode-1.6.yml, and I keep getting the same error.
TASK [artefactual.archivematica-src : Checkout archivematica-storage-service code] ***
fatal: [am-local]: FAILED! => {"changed": false, "cmd": "/usr/bin/git checkout --track -b qa/0.x origin/qa/0.x", "failed": true, "msg": "Failed to checkout qa/0.x", "rc": 1, "stderr": "error: Your local changes to the following files would be overwritten by checkout:\n\t
storage_service/static/js/vendor/base64.js\nPlease, commit your changes or stash them before you can switch branches.\nAborting\n", "stderr_lines": ["error: Your local changes to the following files would be overwritten by checkout:", "\tstorage_service/static/js/vendor/
base64.js", "Please, commit your changes or stash them before you can switch branches.", "Aborting"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/vagrant/singlenode.retry
When I look at src/archivematica-storage-service, I see that branch stable/0.10.x is checked out even though archivematica_src_ss_version is set to "qa/0.x".
roles/artefactual.archivematica-src/tasks/ss-main.yml looks good. The version corresponds to the yml file and force is set to "yes".
Investigating...
The text was updated successfully, but these errors were encountered: