PolishookDavid / LAST_OCS

Code controling the LAST project Observatory
0 stars 0 forks source link

Some git files owned by root - user ocs has insufficient permissions to pull from github #16

Closed noralinn closed 5 months ago

noralinn commented 5 months ago
ocs@last08e:~/matlab/LAST/LAST_OCS$ git pull
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 48 (delta 31), reused 40 (delta 23), pack-reused 0
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed

A few files, e.g., .git/HEAD and files from Feb. 28 in .git/objects, are owned by root and not by ocs. I'm suspecting that this is happening when using last-asroot to pull from github? But it means that we can no longer pull (and maybe push? I didn't try) as ocs from the local computer.

What is the best solution? Modify last-asroot? Change to root when using git commands?

EastEriq commented 5 months ago

Quite likely that I have used thoughtlessly something like last-asroot -c "cd matlab/LAST/LAST-OCS; git checkout j2000InHeader; git pull where I should have instead last-asocs, so my fault.

Does sudo chown -R ocs ~/matlab/LAST/LAST_OCS/.git fix it?

noralinn commented 5 months ago

yes, chown fixes it! Thank you.

I wasn't aware of last-asocs.

EastEriq commented 5 months ago

Well, in fact

ocs@last03e:~/matlab/LAST/LAST_OCS$ last-asocs -H last11e -H last11w -c "last-tool -n make last-software"

[SECT] last11e
last-tool: Must be root to run this tool!

so one has to be root for that. I don't know if there is a solution and whether to reopen

blumzi commented 5 months ago

last-tool -n make user will (among others)