Skip to content
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

Issues with fresh git-annex 7.20191114+git43-ge29663773-1~ndall+1 #3890

Closed
yarikoptic opened this issue Nov 23, 2019 · 7 comments
Closed

Issues with fresh git-annex 7.20191114+git43-ge29663773-1~ndall+1 #3890

yarikoptic opened this issue Nov 23, 2019 · 7 comments

Comments

@yarikoptic
Copy link
Member

0.11.x
https://travis-ci.org/datalad/datalad/builds/615882850?utm_source=github_status&utm_medium=notification
py 2.7 and 3.5 direct (so I guess upgrades to 7)

FAIL: datalad.distribution.tests.test_create_sibling.test_target_ssh_simple
1146----------------------------------------------------------------------
1147Traceback (most recent call last):
1148  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
1149    self.test(*self.arg)
1150  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 869, in newfunc
1151    return func(*args, **kwargs)
1152  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 921, in newfunc
1153    return func(*args, **kwargs)
1154  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 791, in newfunc
1155    t(*(arg + (uri,)), **kw)
1156  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 615, in newfunc
1157    return t(*(arg + (filename,)), **kw)
1158  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 615, in newfunc
1159    return t(*(arg + (filename,)), **kw)
1160  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/distribution/tests/test_create_sibling.py", line 332, in test_target_ssh_simple
1161    assert_set_equal(modified_files, ok_modified_files)
1162AssertionError: Items in the second set but not the first:
1163'.git/objects/info/packs'
1164'.git/info/refs'
1165
1166======================================================================
1167FAIL: datalad.support.tests.test_annexrepo.test_AnnexRepo_dirty
1168----------------------------------------------------------------------
1169Traceback (most recent call last):
1170  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
1171    self.test(*self.arg)
1172  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 615, in newfunc
1173    return t(*(arg + (filename,)), **kw)
1174  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/support/tests/test_annexrepo.py", line 1854, in test_AnnexRepo_dirty
1175    ok_(not repo.dirty)
1176AssertionError: None

and for v5 (also I guess upgrades to 7):

======================================================================
ERROR: datalad.interface.tests.test_ls_webui.test_ls_json
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 442, in newfunc
    return t(*(arg + (d,)), **kw)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 554, in newfunc
    return tfunc(*(args + (path, url)), **kwargs)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/interface/tests/test_ls_webui.py", line 173, in test_ls_json
    ds.add(opj('dir', 'subgit'))                        # add the non-dataset git repo to annex
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/distribution/dataset.py", line 527, in apply_func
    return f(**kwargs)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/interface/utils.py", line 499, in eval_func
    return return_func(generator_func)(*args, **kwargs)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/interface/utils.py", line 487, in return_func
    results = list(results)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/interface/utils.py", line 474, in generator_func
    msg="Command did not complete successfully")
IncompleteResultsError: Command did not complete successfully [{'status': u'error', 'orig_request': u'dir/subgit', 'message': u"'dir/subgit' already exists in the index\n", 'raw_input': True, 'parentds': u'/tmp/datalad_temp_tree_test_ls_jsonlkIb3R', 'action': u'add', 'path': u'/tmp/datalad_temp_tree_test_ls_jsonlkIb3R/dir/subgit', 'type': u'dataset', 'refds': u'/tmp/datalad_temp_tree_test_ls_jsonlkIb3R'}]
======================================================================
FAIL: datalad.distribution.tests.test_create_sibling.test_target_ssh_simple
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 869, in newfunc
    return func(*args, **kwargs)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 921, in newfunc
    return func(*args, **kwargs)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 791, in newfunc
    t(*(arg + (uri,)), **kw)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 615, in newfunc
    return t(*(arg + (filename,)), **kw)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 615, in newfunc
    return t(*(arg + (filename,)), **kw)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/distribution/tests/test_create_sibling.py", line 332, in test_target_ssh_simple
    assert_set_equal(modified_files, ok_modified_files)
AssertionError: Items in the second set but not the first:
'.git/objects/info/packs'
'.git/info/refs'
======================================================================
FAIL: datalad.metadata.tests.test_aggregation.test_partial_aggregation
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 442, in newfunc
    return t(*(arg + (d,)), **kw)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/metadata/tests/test_aggregation.py", line 403, in test_partial_aggregation
    ok_clean_git(path)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/datalad/tests/utils.py", line 211, in ok_clean_git
    eq_(index_diffs, [])
AssertionError: ['sub1\n=======================================================\nlhs: 160000 | 1f25e78d89a958ce5c0cdd0f31b6da24a6ca586a\nrhs: 160000 | 1f25e78d89a958ce5c0cdd0f31b6da24a6ca586a'] != []

master: https://travis-ci.org/datalad/datalad/builds/615883142?utm_source=github_status&utm_medium=notification also has

======================================================================
ERROR: datalad.interface.tests.test_rerun.test_run_inputs_outputs
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/datalad/tests/utils.py", line 429, in newfunc
    return t(*(arg + (d,)), **kw)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/datalad/tests/utils.py", line 602, in newfunc
    return t(*(arg + (filename,)), **kw)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/datalad/interface/tests/test_rerun.py", line 613, in test_run_inputs_outputs
    Dataset(op.join(*((src,) + subds))).create(force=True).save()
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/datalad/distribution/dataset.py", line 523, in apply_func
    return f(**kwargs)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/datalad/interface/utils.py", line 485, in eval_func
    return return_func(generator_func)(*args, **kwargs)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/datalad/interface/utils.py", line 473, in return_func
    results = list(results)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/datalad/interface/utils.py", line 460, in generator_func
    msg="Command did not complete successfully")
datalad.support.exceptions.IncompleteResultsError: Command did not complete successfully [{'status': 'error', 'action': 'add_submodule', 'path': '/tmp/datalad_temp_tree_test_run_inputs_outputssn2oicbi/s0/s1_0/s2', 'message': 'The following path is ignored by one of your .gitignore files:\ns1_0/s2\nUse -f if you really want to add it.\n', 'type': 'dataset'}, {'status': 'error', 'action': 'add_submodule', 'path': '/tmp/datalad_temp_tree_test_run_inputs_outputssn2oicbi/s0/s1_1/s2', 'message': 'The following path is ignored by one of your .gitignore files:\ns1_1/s2\nUse -f if you really want to add it.\n', 'type': 'dataset'}]

may be more ... didn't look into details yet.but there are changes in behavior for annex (and/or git?)

@kyleam
Copy link
Contributor

kyleam commented Dec 3, 2019

I've started to look into some of these.

I can trigger the test_AnnexRepo_dirty failure intermittently on master (f040286) and 0.11.x (892ef79) with a git-annex built from the latest commit (a5fe4d0ac). The unexpected dirty repo is coming from file1.txt, a file tracked by git, being converted to an annex pointer file:

$ git diff
diff --git a/file1.txt b/file1.txt
index 339f0be..336e17d 100644
--- a/file1.txt
+++ b/file1.txt
@@ -1 +1 @@
-something else
\ No newline at end of file
+/annex/objects/SHA256E-s14--f41f3fa625ff120ddca7ef456bf66371ecea23c129f4e4c32367101edb516cf8.txt

Given the flakiness, I haven't tried to bisect it against the annex repo, but I'm able to trigger it with the latest annex release (7.20191114) too. I've tried to reduce the DataLad script to a shell script that does the same operations, but file1.txt is left unmodified (the expected behavior) in the many times I've run the script.

The other tests I've tried locally:

  • I've spent less time looking at test_partial_aggregation, but it also fails only intermittently on my end.

  • I haven't been able to trigger the test_ls_webui.py:test_ls_json failure locally.

  • test_run_inputs_outputs fails on my end reliably. I've yet to look into it, but I plan on having a look at git version differences first.

@kyleam
Copy link
Contributor

kyleam commented Dec 4, 2019

  • test_run_inputs_outputs fails on my end reliably. I've yet to look into it, but I plan on having a look at git version differences first.

It boils down to a change in Git v2.24.0 that leads to ls-files -o ... traversing subdatasets. I've posted to the Git mailing list about it. Given that this involves the most recent Git release, let's see how things settle before considering how to deal with it on our end.

kyleam added a commit to kyleam/datalad that referenced this issue Dec 7, 2019
save_() calls 'ls-files -o' on a list of untracked directories to
determine which directories correspond to untracked submodules.  If
the directories remain unexpanded in the 'ls-files -o' output, they
are taken as submodules.

This method of identifying untracked submodules breaks [0,1] with the
latest release of Git (v2.24.0) due to an unintentional change in the
'ls-files -o' output [2]: when given _multiple_ pathspecs, 'ls-files
-o' recurses into untracked submodules and lists the files from the
submodule (even the tracked ones).  save_() filters the output to
directories, so most of the additional entries are removed, but when
the submodule itself has submodules (untracked or tracked) these and
those from any deeper levels are included in the output.  save_()
passes these deeper repositories to add_submodule(), which as expected
leads to 'git submodule add' failing.

This behavior will hopefully be addressed in Git itself [2], but we
should still provide a workaround for the current version of Git.  Add
a helper that filters these deeper repositories from the list of
submodules that save_() feeds to add_submodule().  This approach takes
advantage of the fact that, even when 'ls-files -o' misbehaves and
traverses into the submodule, it still reports an unexpanded entry.
If it didn't, we wouldn't be able to distinguish a submodule from a
regular directory.

Note that the helper is conditionally defined at the module level; for
earlier versions of Git that don't need this kludge, this reduces the
cost per save_() call to a single call to an identity function.

[0]: datalad#3890 (comment)
[1]: datalad#3902 (comment)
[2]: https://lore.kernel.org/git/87fti15agv.fsf@kyleam.com/T/#u
kyleam added a commit to kyleam/datalad that referenced this issue Dec 7, 2019
save_() calls 'ls-files -o' on a list of untracked directories to
determine which directories correspond to untracked submodules.  If
the directories remain unexpanded in the 'ls-files -o' output, they
are taken as submodules.

This method of identifying untracked submodules breaks [0,1] with the
latest release of Git (v2.24.0) due to an unintentional change in the
'ls-files -o' output [2]: when given _multiple_ pathspecs, 'ls-files
-o' recurses into untracked submodules and lists the files from the
submodule (even the tracked ones).  save_() filters the output to
directories, so most of the additional entries are removed, but when
the submodule itself has submodules (untracked or tracked) these and
those from any deeper levels are included in the output.  save_()
passes these deeper repositories to add_submodule(), which as expected
leads to 'git submodule add' failing.

This behavior will hopefully be addressed in Git itself [2], but we
should still provide a workaround for the current version of Git.  Add
a helper that filters these deeper repositories from the list of
submodules that save_() feeds to add_submodule().  This approach takes
advantage of the fact that, even when 'ls-files -o' misbehaves and
traverses into the submodule, it still reports an unexpanded entry.
If the unexpanded entry wasn't present, we wouldn't be able to
distinguish a submodule from a regular directory.

Note that the helper is conditionally defined at the module level; for
earlier versions of Git that don't need this kludge, this reduces the
cost per save_() call to a single call to an identity function.

[0]: datalad#3890 (comment)
[1]: datalad#3902 (comment)
[2]: https://lore.kernel.org/git/87fti15agv.fsf@kyleam.com/T/#u
kyleam added a commit to kyleam/datalad that referenced this issue Dec 7, 2019
save_() calls 'ls-files -o' on a list of untracked directories to
determine which directories correspond to untracked submodules.  If
the directories remain unexpanded in the 'ls-files -o' output, they
are taken as submodules.

This method of identifying untracked submodules breaks [0,1] with the
latest release of Git (v2.24.0) due to an unintentional change in the
'ls-files -o' output [2]: when given _multiple_ pathspecs, 'ls-files
-o' recurses into untracked submodules and lists the files from the
submodule (even the tracked ones).  save_() filters the output to
directories, so most of the additional entries are removed, but when
the submodule itself has submodules (untracked or tracked) these and
those from any deeper levels are included in the output.  save_()
passes these deeper repositories to add_submodule(), which as expected
leads to 'git submodule add' failing.

This behavior will hopefully be addressed in Git itself [2], but we
should still provide a workaround for the current version of Git.  Add
a helper that filters these deeper repositories from the list of
submodules that save_() feeds to add_submodule().  This approach takes
advantage of the fact that, even when 'ls-files -o' misbehaves and
traverses into the submodule, it still reports an unexpanded entry.
If the unexpanded entry weren't present, we wouldn't be able to
distinguish a submodule from a regular directory.

Note that the helper is conditionally defined at the module level; for
earlier versions of Git that don't need this kludge, this reduces the
cost per save_() call to a single call to an identity function.

[0]: datalad#3890 (comment)
[1]: datalad#3902 (comment)
[2]: https://lore.kernel.org/git/87fti15agv.fsf@kyleam.com/T/#u
@kyleam
Copy link
Contributor

kyleam commented Dec 12, 2019

Going through the last cron builds for master and 0.11.x, here's the list of failures I spot.

  • datalad.interface.tests.test_ls_webui.test_ls_json
    maybe just 0.11.x?
    As mentioned above, I haven't been able to trigger this locally (git-annex 7.20191114, git 2.24.1).
  • datalad.distribution.tests.test_create_sibling.test_target_ssh_simple
    0.11.x and master
    Unable to trigger locally with (git-annex 7.20191114, git 2.24.1, but my "server" git would be seen as 2.20.1).
    Resolved by TST: create-sibling: Loosen check's assumption about Git's behavior #3983.
  • datalad.metadata.tests.test_aggregation.test_partial_aggregation
    0.11.x and master, flaky
    Update: I'm no longer having any luck triggering this locally.
  • datalad.support.tests.test_annexrepo.test_AnnexRepo_dirty
    0.11.x and master, flaky
    git-annex report
  • datalad.distribution.tests.test_install.test_install_noautoget_data
    master
  • datalad.core.local.tests.test_diff.test_path_diff
    master

The last two were papered over by gh-3904, with the underlying issue resolved upstream with this in-flight series.

@kyleam
Copy link
Contributor

kyleam commented Dec 13, 2019

I can trigger the test_AnnexRepo_dirty failure intermittently on master (f040286) and 0.11.x (892ef79) with a git-annex built from the latest commit (a5fe4d0ac). [...] I've tried to reduce the DataLad script to a shell script that does the same operations, but file1.txt is left unmodified (the expected behavior) in the many times I've run the script.

I revisited it and was able to come up with a script that triggered it on my end. Reported on the git-annex site.

@kyleam
Copy link
Contributor

kyleam commented Dec 13, 2019

======================================================================
FAIL: datalad.distribution.tests.test_create_sibling.test_target_ssh_simple

assert_set_equal(modified_files, ok_modified_files)

AssertionError: Items in the second set but not the first:
'.git/objects/info/packs'
'.git/info/refs'

Here's what's being tested there:

# collect which files were expected to be modified without incurring any changes
ok_modified_files = {
_path_('.git/hooks/post-update'), 'index.html',
# files which hook would manage to generate
_path_('.git/info/refs'), '.git/objects/info/packs'
}

It seems very likely that the failure is due to using a later version of Git, but I'd guess the only problem that points to is that test_target_ssh_simple reaches much too far into the implementation guts of git.

@kyleam
Copy link
Contributor

kyleam commented Dec 28, 2019

  • datalad.support.tests.test_annexrepo.test_AnnexRepo_dirty
    0.11.x and master, flaky
    git-annex report

This particular case has been fixed upstream in ea3cb7d27 (2019-12-27). See Joey's comments in that bug report for why in general using -c annex.largefiles=anything/nothing may lead to accidental conversion. Note that git annex add may gain --git and --annex flags, in which case we'll want to adjust AnnexRepo._save_add and friends to map git=True,False to those options (though to do so we'd of course need to either condition on the annex version or bump the minimum required version).

kyleam added a commit to kyleam/datalad that referenced this issue Jan 2, 2020
As of git-annex 7.20191024, test_AnnexRepo_dirty has started to
intermittently fail [0] due to the repository being in an unexpectedly
dirty state, with content that was previously tracked by git converted
to annexed content.  The failure happens due to the combination of two
things:

 1) Calling `git -c annex.largefiles=anything annex add -- FILES` can
    in some cases result in git running git-annex's clean filter on
    files that are _not_ part of FILES.  Importantly the clean filter
    runs within the `-c annex.largefiles=anything` context.

 2) As of 7.20191024, git-annex's clean filter remembers the inode for
    annexed content, leading git-annex to conclude that the regular
    git file in the working tree (file1.txt in this test) should be
    annexed, because the content was tagged as such in 1.

See the associated git-annex bug report [1] for a more complete
description.

git-annex 7.20191230, specifically commit ea3cb7d27, works around this
edge case.  For git-annex versions before this fix but after
7.20191024, skip the test if the "is clean" assertion fails.

[0]: datalad#3890 (comment)
[1]: https://git-annex.branchable.com/bugs/A_case_where_file_tracked_by_git_unexpectedly_becomes_annex_pointer_file/
kyleam added a commit to kyleam/datalad that referenced this issue Jan 2, 2020
As of git-annex 7.20191024, test_AnnexRepo_dirty has started to
intermittently fail [0] due to the repository being in an unexpectedly
dirty state, with content that was previously tracked by git converted
to annexed content.  The failure happens due to the combination of two
things:

 1) Calling `git -c annex.largefiles=anything annex add -- FILES` can
    in some cases result in git running git-annex's clean filter on
    files that are _not_ part of FILES.  Importantly the clean filter
    runs within the `-c annex.largefiles=anything` context.

 2) As of 7.20191024, git-annex's clean filter remembers the inode for
    annexed content, leading git-annex to conclude that the regular
    git file in the working tree (file1.txt in this test) should be
    annexed, because the content was tagged as such in 1.

See the associated git-annex bug report [1] for a more complete
description.

git-annex 7.20191230, specifically commit ea3cb7d27, works around this
edge case.  For git-annex versions before this fix but after
7.20191024, skip the test if the "is clean" assertion fails.

[0]: datalad#3890 (comment)
[1]: https://git-annex.branchable.com/bugs/A_case_where_file_tracked_by_git_unexpectedly_becomes_annex_pointer_file/
kyleam added a commit to kyleam/datalad that referenced this issue Jan 3, 2020
A check in test_target_ssh_simple assumes that executing the
post-update hook will change the modification times of .git/info/refs
and .git/objects/info/packs.  In test runs with more recent Git
versions, this check has started to fail because the modification
times of the files are not updated [0].  This change in behavior is
likely due to Git's f4f476b6a1 (update-server-info: avoid needless
overwrites, 2019-05-13), which was part of the v2.23.0 release.

We could condition the check on the Git version, but, as the now
failing check demonstrates, this check is much too concerned with
internal implementation details of git.  To avoid the test starting to
fail due to another change within .git/ that we do not control, let's
instead update the check to not assume that it knows the strict set of
files that's modified.

[0]: Re: datalad#3890 (comment)
@kyleam
Copy link
Contributor

kyleam commented Jan 3, 2020

OK, to recap the status indicated by the check list, two of six failures remain unaddressed in any way. Both of these tests appear flaky based on Travis runs. One of these I've never triggered locally, and the other one I was able to trigger early on but not recently. I don't have any good ideas how to troubleshoot those. I'm going to open dedicated issues for them and then close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants