Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git hook not working #1308

Open
aashish108 opened this issue Jun 14, 2023 · 3 comments
Open

Git hook not working #1308

aashish108 opened this issue Jun 14, 2023 · 3 comments

Comments

@aashish108
Copy link

aashish108 commented Jun 14, 2023

Hey, been trying to get this git hook working but it simply errors, saying:

[2023-06-14 08:54:43 +0000] [8/Thread-3 (process_request_thread)] [ERROR] An exception occurred during PUT request on '/aa101/bce08ad8-afcc-88b9-76eb-7251211807d3/f7911b3c-60be-4042-8b42-0b65af135b91.ics': Command '([ -d .git ] || git init) && git add -A && (git diff --cached --quiet || git commit -m "Changes by aa101")' returned non-zero exit status 128.

I have git inited the data folder (where the collections folder resides) btw. Not sure what I am doing wrong?

@pbiering
Copy link
Collaborator

Have you tested executing the whole provided command line as same user as radicale daemon is running? According to Internet search results, 128 is a fatal git exit code.

In case of SELinux is active check also the audit log.

@aashish108
Copy link
Author

Have you tested executing the whole provided command line as same user as radicale daemon is running? According to Internet search results, 128 is a fatal git exit code.

In case of SELinux is active check also the audit log.

It's running via Docker. Getting a bit complicated now lol, will have a check.

@jan-krieg
Copy link

Having just run into the same error, maybe you didn't set user.name and user.email in git for the user who's running the radicale daemon?

After setting the hook and modifying a calendar entry to trigger it, I got the same error message and found that while the .git/ folder got created and all the files added, no commit had been performed (indicating that the hook had failed at the last command).
After manually editing the .git/config file to add user.name and user.email in the usual way, the hook is now running just fine.

As a consistency check, I've checked for a different user with shell access (but who has no .gitconfig) what happens when doing git init; git add test.txt; git commit - 'Initial commit' and found that this results in fatal: unable to auto-detect email address with error code 128, thus agreeing with the error code in the logs.

There's already some pull requests on the topic as the current documentation is lacking in this regard, see e.g. #883 #913 #914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants