No you should not need to run this. However since this installation has not been touched in a long time I would recommend going through the change logs to ensure that all required maintenance has been done.
...
[x.x.x.x] sudo: git reset --hard 05ebc51ba4b16a420f0fd64c17ffad89501ea36d
[x.x.x.x] out: HEAD est maintenant à 05ebc51ba4b Merge pull request #28632 from dimagi/dm/rm-errand-boy
[x.x.x.x] out:
[x.x.x.x] sudo: git submodule sync
[x.x.x.x] out: Synchronisation de l'URL sous-module pour 'corehq/apps/hqmedia/static/hqmedia/MediaUploader'
[x.x.x.x] out: Synchronisation de l'URL sous-module pour 'submodules/commcare-translations'
[x.x.x.x] out: Synchronisation de l'URL sous-module pour 'submodules/couchdbkit-aggregate'
[x.x.x.x] out: Synchronisation de l'URL sous-module pour 'submodules/django-digest-src'
[x.x.x.x] out: Synchronisation de l'URL sous-module pour 'submodules/django-no-exceptions'
[x.x.x.x] out: Synchronisation de l'URL sous-module pour 'submodules/langcodes'
[x.x.x.x] out: Synchronisation de l'URL sous-module pour 'submodules/python-digest'
[x.x.x.x] out: Synchronisation de l'URL sous-module pour 'submodules/xml2json'
[x.x.x.x] out:
[x.x.x.x] sudo: git submodule update --init --recursive -q
[x.x.x.x] out: fatal: impossible de se connecter à github.com :
[x.x.x.x] out: github.com[0: 140.82.121.4]: errno=Connexion terminée par expiration du délai d'attente
[x.x.x.x] out:
[x.x.x.x] out: fatal: impossible de se connecter à github.com :
[x.x.x.x] out: github.com[0: 140.82.121.3]: errno=Connexion terminée par expiration du délai d'attente
[x.x.x.x] out:
[x.x.x.x] out: Chemin de sous-module 'submodules/langcodes' récupéré, mais il ne contenait pas 170e74cf47c4757502bc1654414930685aacaa5a. La récupération directe de ce commit a échoué.
[x.x.x.x] out:
Fatal error: sudo() received nonzero return code 1 while executing!
Hi, the commit definitely does exist (Add Nuer · dimagi/langcodes@170e74c · GitHub). I think the issue may be related to the errors above that which are connection timeouts connecting to Github.
You could try running the command manually to see if the error persists:
sudo -iu cchq
cd /home/cchq/www/monolith/releases/2022-07-05_09.21
git submodule update --init --recursive
(monolith) cchq@monolith:~$ cd /home/cchq/www/monolith/releases/2022-07-05_09.21
(monolith) cchq@monolith:~/www/monolith/releases/2022-07-05_09.21$ git submodule update --init --recursive
fatal: impossible de se connecter à github.com : github.com[0: 140.82.121.3]: errno=Connexion terminée par expiration du délai d'attente
Impossible de rapatrier dans le chemin de sous-module 'submodules/langcodes' ; essai de rapatriement direct de 170e74cf47c4757502bc1654414930685aacaa5a :
fatal: impossible de se connecter à github.com : github.com[0: 140.82.121.3]: errno=Connexion terminée par expiration du délai d'attente
Chemin de sous-module 'submodules/langcodes' récupéré, mais il ne contenait pas 170e74cf47c4757502bc1654414930685aacaa5a. La récupération directe de ce commit a échoué.
Hello Ethan & @Simon_Kelly,
Sorry for the delay. I had an issue with my hoster..
Command execution on release i try to deploy :
(monolith) cchq@monolith:~/www/monolith/releases/2022-07-15_12.13$ git submodule foreach 'git remote -v'
Entrée dans 'corehq/apps/hqmedia/static/hqmedia/MediaUploader'
origin git://github.com/dimagi/MediaUploader.git (fetch)
origin git://github.com/dimagi/MediaUploader.git (push)
Entrée dans 'submodules/commcare-translations'
origin git://github.com/dimagi/commcare-translations.git (fetch)
origin git://github.com/dimagi/commcare-translations.git (push)
Entrée dans 'submodules/couchdbkit-aggregate'
origin git://github.com/dimagi/couchdbkit-aggregate.git (fetch)
origin git://github.com/dimagi/couchdbkit-aggregate.git (push)
Entrée dans 'submodules/django-digest-src'
origin git://github.com/dimagi/django-digest.git (fetch)
origin git://github.com/dimagi/django-digest.git (push)
Entrée dans 'submodules/django-no-exceptions'
origin git://github.com/dimagi/django-no-exceptions.git (fetch)
origin git://github.com/dimagi/django-no-exceptions.git (push)
Entrée dans 'submodules/langcodes'
origin git://github.com/dimagi/langcodes.git (fetch)
origin git://github.com/dimagi/langcodes.git (push)
Entrée dans 'submodules/python-digest'
origin git://github.com/dimagi/python-digest.git (fetch)
origin git://github.com/dimagi/python-digest.git (push)
Entrée dans 'submodules/xml2json'
origin git://github.com/dimagi/xml2json.git (fetch)
origin git://github.com/dimagi/xml2json.git (push)
This is surprising because I have changed the format of the url in the current version as you can see here to correct the issue identified in the post you quoted (That looks like the issue @jmiller found here):
[x.x.x.x] sudo: git clone /home/cchq/www/monolith/current/.git /home/cchq/www/monolith/releases/2022-07-15_12.13
[x.x.x.x] out: fatal: le chemin de destination '/home/cchq/www/monolith/releases/2022-07-15_12.13' existe déjà et n'est pas un répertoire vide.
[x.x.x.x] out:
Fatal error: sudo() received nonzero return code 128 while executing!
I'm not sure it's worth resuming the deploy - have you tried just doing a new one entirely?
There should be multiple copies of the git repository inside ~/www/monolith/releases/, one for each recent release (the deploy script deletes the older ones eventually). When a deploy is run, it copies the currently active repo to a new directory. I suspect what may have happened is you correctly updated the URLs for the new directory, but not for the old one, then on redeploy, it overwrote it again.
I'd make sure to update the URLs for the current repo (the one aliased to ~/www/monolith/current/), then try a new deploy without using --resume.
I don't understand why in the release I want to deploy (05ebc51ba4b16a420f0fd64c17ffad89501ea36d) the urls are not correct although the urls are correct in the current version.
I have suspicion that the git clone of the current release when deploying is not working properly, or that there is some other problem.
Does this make sense?
.gitmodules, multiple configurations found for 'submodule.corehq/apps/hqmedia/static/hqmedia/MediaUploader.path'. Skipping second one!
I wonder if somehow the submodules are configured twice each, with different URL formats. Not sure how that could've happened, but I suspect you'll need to correct that manually.
Yes, it must get this old format somewhere when deploying.
During the deployment a git clone /home/cchq/www/monolith/current/.git /home/cchq/www/monolith/releases/XXX is made, so the url should be retrieved at that time (is it right?). But I have checked the configuration files, the urls is correct.
I will keep searching in that way.
I hope to find the solution soon.
I hope you will find a solution too.
I have a question.
When deploy command is executed, what is it supposed to do with .git repository and .gitmodules file of current release ? Make an exact copy or copy first and pull from head inside ?