ministryofjustice / justice-gov-uk

Justice UK website
https://www.justice.gov.uk/
MIT License
2 stars 0 forks source link

Bug in mercurial / hg is preventing build. #261

Closed EarthlingDavey closed 5 days ago

EarthlingDavey commented 1 week ago

See https://bugs-devel.debian.org/cgi-bin/bugreport.cgi?bug=1076747

 => ERROR [nginx nginx-module-builder 4/7] RUN hg clone -r 1.26.2-1 https://hg.nginx.org/pkg-oss/     && cd pkg-oss     && mkdir -p /tmp/packages                                                          0.1s
------                                                                                                                                                                                                          
 > [nginx nginx-module-builder 4/7] RUN hg clone -r 1.26.2-1 https://hg.nginx.org/pkg-oss/     && cd pkg-oss     && mkdir -p /tmp/packages:
0.102 + hg clone -r 1.26.2-1 https://hg.nginx.org/pkg-oss/
0.117 Traceback (most recent call last):
0.117   File "/usr/bin/hg", line 57, in <module>
0.117     from mercurial import dispatch
0.117   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
0.117   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
0.117   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
0.117   File "/usr/lib/python3.12/site-packages/hgdemandimport/demandimportpy3.py", line 52, in exec_module
0.117     super().exec_module(module)
0.117   File "<frozen importlib.util>", line 257, in exec_module
0.117   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
0.117   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
0.117   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
0.117   File "/usr/lib/python3.12/site-packages/hgdemandimport/demandimportpy3.py", line 52, in exec_module
0.117     super().exec_module(module)
0.117   File "<frozen importlib.util>", line 267, in exec_module
0.117 AttributeError: partially initialized module 'threading' has no attribute 'RLock' (most likely due to a circular import)
wilson1000 commented 1 week ago

Hey @EarthlingDavey 👋🏼 the issue is Nginx 1.26.2 - wr can lock the versions to 1.26.1, as we did in the Intranet Dockerfile and the build will engage.

EarthlingDavey commented 5 days ago

Good morning, I'm not convinced the nginx version is the issue.

If we split the lines of the dockerfile up, the error occurs at line

RUN hg clone -r 1.26.2-1 https://hg.nginx.org/pkg-oss/

It's caused by a bug in hr, from what I've read it's because of a bug in one of it's dependencies.

I'll explore rolling back to 1.26.1, hopefully that will sort it 🤞 though theres a chance it might not be so straightforward.

EarthlingDavey commented 5 days ago

I've just run docker compose build nginx and it's building ok.

There must have been some dependency that was broken on Fri but has been fixed over the weekend.

wilson1000 commented 5 days ago

Launched a discussion here: https://github.com/ministryofjustice/justice-gov-uk/discussions/262