Zulip Chat Archive

Stream: FLT-regular

Topic: Deploy error


Riccardo Brasca (Apr 13 2022 at 21:42):

Does anyone understand the error CI is reporting? It is in the "deploy" step.

Chris Birkbeck (Apr 13 2022 at 21:46):

hmm it seems to have messed up the blueprint

Riccardo Brasca (Apr 13 2022 at 21:53):

Can be related to this?

Chris Birkbeck (Apr 13 2022 at 21:55):

It could be, I would have thought it would have broken sooner. I did check it a few weeks ago and it was working.

Chris Birkbeck (Apr 13 2022 at 21:58):

(at least I think it was a few weeks ago, I may have lost all notion of time)

Mauricio Collares (Apr 13 2022 at 22:01):

It's probably due to https://github.blog/2022-04-12-git-security-vulnerability-announced/ (git was updated in Alpine since the last commit: https://pkgs.alpinelinux.org/package/edge/main/x86/git)

Mauricio Collares (Apr 13 2022 at 22:03):

The error means git thinks it's not running on a repository, and Git 2.35.2 changed how far Git looks for a .git folder to determine it's in a repository in some cases.

Chris Birkbeck (Apr 13 2022 at 22:23):

Aha I see. Any idea on how to fix this? I looked online and people mentioned things like adding directories to a "safe.directory" but I'm not sure how to do this, or if this would even work

Mauricio Collares (Apr 13 2022 at 22:26):

I submitted a PR to flt-regular with this suggestion, but it is completely untested

Chris Birkbeck (Apr 13 2022 at 22:29):

sure lets try it! the blueprint cant get any more broken :joy:

Patrick Massot (Apr 13 2022 at 22:33):

This has nothing to do with the dependency graph stuff I mentioned in February

Patrick Massot (Apr 13 2022 at 22:33):

The error comes from https://github.com/gitpython-developers/GitPython

Patrick Massot (Apr 13 2022 at 22:34):

It could be that newer versions of git are no longer compatible with that python library and that the security issue forced GitHub to update git

Mauricio Collares (Apr 13 2022 at 22:34):

Chris Birkbeck said:

sure lets try it! the blueprint cant get any more broken :joy:

Another alternative would be to not use apk to install git, and just rely on the provided Git binary. Lots of projects are hitting similar issues, and they will probably be addressed soon, so being on the bleeding edge is not advisable.

Mauricio Collares (Apr 13 2022 at 22:44):

Yeah, that didn't work :/

Chris Birkbeck (Apr 13 2022 at 22:44):

yeah :( at least its now tested

Mauricio Collares (Apr 13 2022 at 22:45):

But I saw those messages in the log:

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.

This seems to suggest the deploy commands are being run as root, while the checkout isn't (which would cause the issue).

Mauricio Collares (Apr 13 2022 at 22:49):

Git configs are per-user, right? So (besides the possibly-wrong directory name), I think I should have added that command to the "Install Leanblueprint and generate web in tex env" step itself, since that's probably the only thing that runs inside the TeXLive docker environment.

Mauricio Collares (Apr 13 2022 at 22:49):

And since things are being run inside the container, we really have to install git ourselves via apk, so my alternative solution makes no sense.

Chris Birkbeck (Apr 13 2022 at 22:53):

aha ok, where in that step would it go? or perhaps you can just try PRing the fix again?

Mauricio Collares (Apr 13 2022 at 22:55):

Submitted! I hope the backticks do the expected thing, as I didn't know if Git would do the right thing if I asked it to add . to safe.directory

Chris Birkbeck (Apr 13 2022 at 22:56):

:fingers_crossed:

Riccardo Brasca (Apr 13 2022 at 23:01):

I'm done for today, but thanks for working on this!

Mauricio Collares (Apr 13 2022 at 23:13):

Okay, this time it worked! I don't know which of the two commands did the trick though :)

Chris Birkbeck (Apr 13 2022 at 23:20):

great! unfortunately the blueprint is still messed up. I'll have to get back to this tomorrow or Friday :(

Mauricio Collares (Apr 13 2022 at 23:31):

The blueprint broke on March 26th. https://github.com/leanprover-community/flt-regular/commit/b2a67c94be89ab8b2f351661419e8246c083f90c. Same thing happened to liquid, but I believe @Johan Commelin just disabled CI and generated files manually.

Mauricio Collares (Apr 13 2022 at 23:56):

Looks like plastex uses jinja2.contextfunction, which was deprecated a year ago and removed in Jinja 3.1.0 (released March 23rd). There are some examples of the new API at https://jinja.palletsprojects.com/en/3.1.x/api/#evaluation-context

Johan Commelin (Apr 14 2022 at 04:21):

cc @Patrick Massot

Patrick Massot (Apr 14 2022 at 07:36):

I have zero time today but I tried a blind fix. If it works then great but otherwise this will have to wait a bit

Chris Birkbeck (Apr 15 2022 at 08:37):

Patrick Massot said:

I have zero time today but I tried a blind fix. If it works then great but otherwise this will have to wait a bit

Well the blueprint is working again, so it seems to have worked! Thank you!

Riccardo Brasca (Apr 15 2022 at 08:42):

Thanks!!

Riccardo Brasca (Apr 13 2022 at 21:42):

Does anyone understand the error CI is reporting? It is in the "deploy" step.

Chris Birkbeck (Apr 13 2022 at 21:46):

hmm it seems to have messed up the blueprint

Riccardo Brasca (Apr 13 2022 at 21:53):

Can be related to this?

Chris Birkbeck (Apr 13 2022 at 21:55):

It could be, I would have thought it would have broken sooner. I did check it a few weeks ago and it was working.

Chris Birkbeck (Apr 13 2022 at 21:58):

(at least I think it was a few weeks ago, I may have lost all notion of time)

Mauricio Collares (Apr 13 2022 at 22:01):

It's probably due to https://github.blog/2022-04-12-git-security-vulnerability-announced/ (git was updated in Alpine since the last commit: https://pkgs.alpinelinux.org/package/edge/main/x86/git)

Mauricio Collares (Apr 13 2022 at 22:03):

The error means git thinks it's not running on a repository, and Git 2.35.2 changed how far Git looks for a .git folder to determine it's in a repository in some cases.

Chris Birkbeck (Apr 13 2022 at 22:23):

Aha I see. Any idea on how to fix this? I looked online and people mentioned things like adding directories to a "safe.directory" but I'm not sure how to do this, or if this would even work

Mauricio Collares (Apr 13 2022 at 22:26):

I submitted a PR to flt-regular with this suggestion, but it is completely untested

Chris Birkbeck (Apr 13 2022 at 22:29):

sure lets try it! the blueprint cant get any more broken :joy:

Patrick Massot (Apr 13 2022 at 22:33):

This has nothing to do with the dependency graph stuff I mentioned in February

Patrick Massot (Apr 13 2022 at 22:33):

The error comes from https://github.com/gitpython-developers/GitPython

Patrick Massot (Apr 13 2022 at 22:34):

It could be that newer versions of git are no longer compatible with that python library and that the security issue forced GitHub to update git

Mauricio Collares (Apr 13 2022 at 22:34):

Chris Birkbeck said:

sure lets try it! the blueprint cant get any more broken :joy:

Another alternative would be to not use apk to install git, and just rely on the provided Git binary. Lots of projects are hitting similar issues, and they will probably be addressed soon, so being on the bleeding edge is not advisable.

Mauricio Collares (Apr 13 2022 at 22:44):

Yeah, that didn't work :/

Chris Birkbeck (Apr 13 2022 at 22:44):

yeah :( at least its now tested

Mauricio Collares (Apr 13 2022 at 22:45):

But I saw those messages in the log:

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.

This seems to suggest the deploy commands are being run as root, while the checkout isn't (which would cause the issue).

Mauricio Collares (Apr 13 2022 at 22:49):

Git configs are per-user, right? So (besides the possibly-wrong directory name), I think I should have added that command to the "Install Leanblueprint and generate web in tex env" step itself, since that's probably the only thing that runs inside the TeXLive docker environment.

Mauricio Collares (Apr 13 2022 at 22:49):

And since things are being run inside the container, we really have to install git ourselves via apk, so my alternative solution makes no sense.

Chris Birkbeck (Apr 13 2022 at 22:53):

aha ok, where in that step would it go? or perhaps you can just try PRing the fix again?

Mauricio Collares (Apr 13 2022 at 22:55):

Submitted! I hope the backticks do the expected thing, as I didn't know if Git would do the right thing if I asked it to add . to safe.directory

Chris Birkbeck (Apr 13 2022 at 22:56):

:fingers_crossed:

Riccardo Brasca (Apr 13 2022 at 23:01):

I'm done for today, but thanks for working on this!

Mauricio Collares (Apr 13 2022 at 23:13):

Okay, this time it worked! I don't know which of the two commands did the trick though :)

Chris Birkbeck (Apr 13 2022 at 23:20):

great! unfortunately the blueprint is still messed up. I'll have to get back to this tomorrow or Friday :(

Mauricio Collares (Apr 13 2022 at 23:31):

The blueprint broke on March 26th. https://github.com/leanprover-community/flt-regular/commit/b2a67c94be89ab8b2f351661419e8246c083f90c. Same thing happened to liquid, but I believe @Johan Commelin just disabled CI and generated files manually.

Mauricio Collares (Apr 13 2022 at 23:56):

Looks like plastex uses jinja2.contextfunction, which was deprecated a year ago and removed in Jinja 3.1.0 (released March 23rd). There are some examples of the new API at https://jinja.palletsprojects.com/en/3.1.x/api/#evaluation-context

Johan Commelin (Apr 14 2022 at 04:21):

cc @Patrick Massot

Patrick Massot (Apr 14 2022 at 07:36):

I have zero time today but I tried a blind fix. If it works then great but otherwise this will have to wait a bit

Chris Birkbeck (Apr 15 2022 at 08:37):

Patrick Massot said:

I have zero time today but I tried a blind fix. If it works then great but otherwise this will have to wait a bit

Well the blueprint is working again, so it seems to have worked! Thank you!

Riccardo Brasca (Apr 15 2022 at 08:42):

Thanks!!


Last updated: Dec 20 2023 at 11:08 UTC