Closed ananyo2012 closed 5 years ago
@vigneshsarma Can you have a look ?
It seems like our clone of Junction is corrupted. Refer: https://stackoverflow.com/questions/20870895/how-to-diagnose-and-fix-git-fatal-unable-to-read-tree
This is what I am seeing,
junction$ git reset --hard 5823dcb83dffbe122ca81ce20d52f4688627ad79
fatal: unable to read tree 5823dcb83dffbe122ca81ce20d52f4688627ad79
Sadly our git version is old and we don't have the command to fix the clone where it is.
I cloned it to a tmp
and retried it like so,
/tmp$ git clone https://github.com/pythonindia/junction.git
Cloning into 'junction'...
remote: Counting objects: 7240, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 7240 (delta 19), reused 20 (delta 13), pack-reused 7196
Receiving objects: 100% (7240/7240), 3.92 MiB | 911.00 KiB/s, done.
Resolving deltas: 100% (5010/5010), done.
Checking connectivity... done.
root@in:/tmp$ cd junction/
/tmp/junction$ git reset --hard 5823dcb83dffbe122ca81ce20d52f4688627ad79
HEAD is now at 5823dcb Adding a Proposals API (#566)
So it seems like we have to delete the existing clone/folder and rerun provision. We should do this when the traffic is lowest. Also, we should make sure if there are info inside these folders that we might need like, uploads etc are preserved.
Can you help me with figuring out,
It seems like our clone of Junction is corrupted. Refer: https://stackoverflow.com/questions/20870895/how-to-diagnose-and-fix-git-fatal-unable-to-read-tree
This is what I am seeing,
junction$ git reset --hard 5823dcb83dffbe122ca81ce20d52f4688627ad79 fatal: unable to read tree 5823dcb83dffbe122ca81ce20d52f4688627ad79
I think this is because the commit is not present in the current version. Can you check once? Also is git reset needed for pulling in a new change?
Sadly our git version is old and we don't have the command to fix the clone where it is.
Yes I do see git related errors when I try to run provision to pull in a new change for the PyCon India website. I will share the log when I get it next time
Can you help me with figuring out,
- what would be a safe time to take the site down and delete the folder?
I am not aware if we are tracking the website traffic. I will try to check with some folks if there is something already present. If its not there I will need to few days to check the traffic in case ww have to set it up.
- What all if any uncommitted info within the folder needs to be backed up?
Yeah then probably we have to reapply those Changes. I can do that. Let me first check the first point to begin with.
I think this is because the commit is not present in the current version. Can you check once? Also is git reset needed for pulling in a new change?
Ah ok git fetches the entire commit history with a git fetch or git ls-remote in this case I think. So salt uses git reset --hard <commit_hash>
to get the latest commit. The link here https://stackoverflow.com/questions/20870895/how-to-diagnose-and-fix-git-fatal-unable-to-read-tree mentions that re-cloning might not solve the problem
I got the issue temporarily fixed by following these steps
git pull origin master
provision
systemctl restart junction
But we have to do this each time a new change is to be merged in junction
Also here is the issue I am facing while updating the inpycon2018 website. This occurs when I am running provision for the first time after update. But when I run provision for the second time it works fine
[INFO ] Executing command [u'git', u'diff', u'HEAD'] in directory '/opt/inpycon2018'
[INFO ] Executing command [u'git', u'rev-parse', u'481141cdb56e8c15743789b748414d92499b0ab4^{commit}'] in directory '/opt/inpycon2018'
[DEBUG ] stdout: 481141cdb56e8c15743789b748414d92499b0ab4^{commit}
[DEBUG ] stderr: fatal: ambiguous argument '481141cdb56e8c15743789b748414d92499b0ab4^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[DEBUG ] retcode: 128
[INFO ] Executing command [u'git', u'rev-parse', u'--abbrev-ref', u'master@{upstream}'] in directory '/opt/inpycon2018'
[DEBUG ] stdout: origin/master
[INFO ] Executing command [u'git', u'ls-remote', u'--tags', u'origin'] in directory '/opt/inpycon2018'
[INFO ] Executing command [u'git', u'fetch', u'origin', u'refs/heads/*:refs/remotes/origin/*', u'+refs/tags/*:refs/tags/*'] in directory '/opt/inpycon2018'
[ERROR ] Command '[u'git', u'fetch', u'origin', u'refs/heads/*:refs/remotes/origin/*', u'+refs/tags/*:refs/tags/*']' failed with return code: 1
[ERROR ] stdout: From https://github.com/pythonindia/inpycon2018
! [rejected] gh-pages -> origin/gh-pages (non-fast-forward)
c842991..481141c master -> origin/master
[ERROR ] retcode: 1
[ERROR ] Fetch failed. Set 'force_fetch' to True to force the fetch if the failure was due to not being able to fast-forward. Output of the fetch command follows:
From https://github.com/pythonindia/inpycon2018
! [rejected] gh-pages -> origin/gh-pages (non-fast-forward)
c842991..481141c master -> origin/master
[INFO ] Completed state [https://github.com/pythonindia/inpycon2018.git] at time 23:02:19.149350 (duration_in_ms=5402.166)
----------
ID: https://github.com/pythonindia/inpycon2018.git
Function: git.latest
Result: False
Comment: Fetch failed. Set 'force_fetch' to True to force the fetch if the failure was due to not being able to fast-forward. Output of the fetch command follows:
From https://github.com/pythonindia/inpycon2018
! [rejected] gh-pages -> origin/gh-pages (non-fast-forward)
c842991..481141c master -> origin/master
Started: 23:02:13.747184
Duration: 5402.166 ms
Changes:
not happening any more
So I did a
systemctl restart junction
to restart the junction service logged in as root. But then the junction services started failing in subsequent runs of provision scriptError Logs