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

Writing to ballot.yml fails with a permission denied error #3

Closed
RaisinTen opened this issue Feb 5, 2022 · 3 comments
Closed

Writing to ballot.yml fails with a permission denied error #3

RaisinTen opened this issue Feb 5, 2022 · 3 comments

Comments

@RaisinTen
Copy link

RaisinTen commented Feb 5, 2022

System info:

$ uname -a
Darwin Darshans-MacBook-Pro.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 x86_64
$ openssl version
OpenSSL 3.0.1 14 Dec 2021 (Library: OpenSSL 3.0.1 14 Dec 2021)

Logs:

$ sh ./voteUsingGit.sh \
  RaisinTen \
  git@github.com:nodejs/TSC.git \
  vote-primordials-error-path \
  votes/primordials-error-path
Cloning into '.'...
remote: Enumerating objects: 304, done.
remote: Counting objects: 100% (304/304), done.
remote: Compressing objects: 100% (295/295), done.
remote: Total 304 (delta 12), reused 162 (delta 7), pack-reused 0
Receiving objects: 100% (304/304), 2.23 MiB | 2.40 MiB/s, done.
Resolving deltas: 100% (12/12), done.
./voteUsingGit.sh: line 20: /var/folders/1s/mr6_sxdx0_59tj0xq5qzt_z00000gn/T/tmp.u5ibUVMK/votes/primordials-error-path/ballot.yml: Permission denied
./voteUsingGit.sh: line 23: /Users/raisinten/Desktop/temp/project/sh/encryptBallot.sh: No such file or directory
[vote-primordials-error-path 1466e68] vote from RaisinTen
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 votes/primordials-error-path/RaisinTen.json
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 1.03 KiB | 1.03 MiB/s, done.
Total 5 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To github.com:nodejs/TSC.git
   a619c98..1466e68  HEAD -> vote-primordials-error-path

This ends up committing and pushing an empty file.

Workaround:

I believe running with sudo should be a temporary fix for now.

@RaisinTen
Copy link
Author

Running with sudo doesn't seem to allow me to recast the vote. 🤔

$ sudo sh ./voteUsingGit.sh \
  RaisinTen \
  git@github.com:nodejs/TSC.git \
  vote-primordials-error-path \
  votes/primordials-error-path
Password:
Cloning into '.'...
The authenticity of host 'github.com (13.234.210.38)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
remote: Enumerating objects: 305, done.
remote: Counting objects: 100% (305/305), done.
remote: Compressing objects: 100% (295/295), done.
remote: Total 305 (delta 12), reused 163 (delta 7), pack-reused 0
Receiving objects: 100% (305/305), 2.23 MiB | 2.41 MiB/s, done.
Resolving deltas: 100% (12/12), done.
./voteUsingGit.sh: line 20: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.u1UoIdLI/votes/primordials-error-path/ballot.yml: Permission denied
./voteUsingGit.sh: line 23: /Users/raisinten/Desktop/temp/project/sh/encryptBallot.sh: No such file or directory
On branch vote-primordials-error-path
Your branch is up to date with 'origin/vote-primordials-error-path'.

nothing to commit, working tree clean
Everything up-to-date

@stduhpf
Copy link
Contributor

stduhpf commented Feb 5, 2022

Thanks for the report

Looks like your $EDITOR environement variable isn't defined.
There's also another issue: the script expects to find an exectuable named encryptBallot.sh. The example should have downloaded it, we overlooked that part. (Antoine updated the instructions to fix this)

The script should warn you about it, that should be taken care of with 414518e.

@stduhpf stduhpf closed this as completed Feb 5, 2022
@aduh95
Copy link
Contributor

aduh95 commented Feb 5, 2022

Looks like your $EDITOR environement variable isn't defined.

To fix that, you can either define $EDITOR in your .bashrc (or .zshrc or whichever shell you are using), or define it inline like this:

curl -LOJ https://github.com/stduhpf/caritat/raw/HEAD/sh/voteUsingGit.sh
curl -LOJ https://github.com/stduhpf/caritat/raw/HEAD/sh/encryptBallot.sh
chmod +x encryptBallot.sh
EDITOR=nano sh ./voteUsingGit.sh \
  RaisinTen \
  git@github.com:nodejs/TSC.git \
  vote-primordials-error-path \
  votes/primordials-error-path
rm encryptBallot.sh
rm voteUsingGit.sh

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

No branches or pull requests

3 participants