WeBWorK Main Forum

"Couldn't find branch in remote origin" error message

Re: "Couldn't find branch in remote origin" error message

by Glenn Rice -
Number of replies: 3

It sounds like you have some permissions issues in your .git subdirectories.  Most likely that is the result of running a git command as root.  You should never do that.  To fix that run
     sudo chown -R wwadmin:wwadmin .git
in both the /opt/webwork/webwork2 and /opt/webwork/pg directories.

What is the output when you run:
    git log -1 --pretty=format:%at
in /opt/webwork/libraries/webwork-open-problem-library

Also, what is the output when you run:
    ls -l /opt/webwork/webwork2/htdocs/DATA


In reply to Glenn Rice

Re: "Couldn't find branch in remote origin" error message

by Larry Riddle -
Permissions fixed. Thanks.

wwadmin@swoop:/opt/webwork/libraries/webwork-open-problem-library$ git log -1 --pretty=format:%at
1629407085

wwadmin@swoop:/opt/webwork/libraries/webwork-open-problem-library$ ls -l /opt/webwork/webwork2/htdocs/DATA
total 1208
-rw-rw-r-- 1 wwadmin wwadmin 155276 Dec 30 2020 library-directory-tree.json
-rw-rw-r-- 1 wwadmin wwadmin 169639 Dec 30 2020 library-subject-tree.json
-rwxrwxr-x 1 wwadmin wwadmin 70 Jun 23 2015 README
-rw-rw-r-- 1 wwadmin wwadmin 58121 Jul 24 2021 tagging-taxonomy.json
-rw-rw-r-- 1 wwadmin wwadmin 843770 Dec 30 2020 textbook-tree.json

I just reran the git fetch command in webwork2 and pg, and now the result is

wwadmin@swoop:/opt/webwork/webwork2$ git fetch
From https://github.com/openwebwork/webwork2
   9bdbc1c5b..2d69c283e  develop    -> origin/develop

wwadmin@swoop:/opt/webwork/pg$ git fetch
From https://github.com/openwebwork/pg
   8addfac0..7d3bad2e  develop    -> origin/develop
In reply to Larry Riddle

Re: "Couldn't find branch in remote origin" error message

by Glenn Rice -

Are you still getting the messages about not being able to find the branch main in the remote origin in the webwork2/admin course?  I suspect that you are.  In fact, that is all anyone is ever going to get from the webwork2 update notification from now on it seems.  Looking closer at this, it seems that the approach that has been used of having the server execute git commands to determine if upgrades are available is dead in the water.  The server user (usually www-data on Ubuntu) can not run git commands on a repository it does not own.  This is something that has changed recently with git.  There may be workarounds to make it work, but none of them are secure.

I recommend that you disable webwork2 upgrade notifications.   Set "$enableGitUpgradeNotifier = 1;" in localOverrides.conf.

In reply to Glenn Rice

Re: "Couldn't find branch in remote origin" error message

by Larry Riddle -

Yes, I was still getting the messages, but I did turn off the upgrade notifications (I think you meant to write setting it equal to 0, not 1) and now they are gone.

Thank you again, Glenn, for all your help and suggestions.