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

Exercism can't use mkdir #945

Closed
Llcoolsouder opened this issue Jun 19, 2020 · 13 comments
Closed

Exercism can't use mkdir #945

Llcoolsouder opened this issue Jun 19, 2020 · 13 comments

Comments

@Llcoolsouder
Copy link

OS: Ubuntu

Running exercism configure ... gives error mkdir /home/$USER/.config/exercism permission denied
Even after running chmod 777 ~/.config this error still occurs. Running with sudo alleviates the problem.

But then after configuring, running exercism download ... I get another permission denied error for mkdir n the workspace directory even with sudo

@NobbZ
Copy link
Member

NobbZ commented Jun 19, 2020

What method of installation did you choose? Who owns ~/.config? Do you have perhaps SElinux or similar in place (sestatus and getenforce will check for SElinux availability and its current enforcement policy)?

My guess: ~/.config is owned by you, you installed via snap and SElinux is currently in Enforced mode…

@Llcoolsouder
Copy link
Author

I installed via snap. I own ~/.config. I don't believe I have SElinux in place. sestatus returns disabled.

@Llcoolsouder
Copy link
Author

Ok, so I got it working (I probably broke some things along the way, but I probably wouldn't have had any issue at all if this machine wasn't already screwed up from younger me 🤷 )

So I got all of the permission set up, but exercism still couldn't open ~/.config/exercism/user.json because it didn't exist, so I created that file, and THEN exercism configure <options> worked.

Then when I ran exercism download <options> I was getting this message.

Error: 

    Welcome to Exercism!

    To get started, you need to configure the tool with your API token.
    Find your token at

        https://exercism.io/my/settings

    Then run the configure command:

        /snap/exercism/5/exercism configure --token=YOUR_TOKEN

So I set the symbolic link which was previously /snap/bin/exercism -> /usr/bin/snap to /snap/bin/exercism -> /snap/exercism/5/exercism.

So far everything is working now. I just think it's odd that it was an issue to begin with.

@richardneish
Copy link

I'm also seeing this issue on Ubuntu 20.04, installed from snap.
Running exercism configure --token <TOKEN> results in the error Error: open /home/$USER/.config/exercism/user.json: permission denied
If I run /snap/exercism/current/exercism configure --token <TOKEN> it seems to work properly.

Is this a general problem with snap?

@NobbZ
Copy link
Member

NobbZ commented Nov 24, 2020

There are known and reoccuring but irreproducible problems coming up with snap on a regular basis. Mostly solved by either circumventing snap sandbox or removing the snap in favor of a manual installation.

Therefore I have created #973 right now, which would basically solve all of the issues we have with snap.

ekingery pushed a commit that referenced this issue Feb 9, 2021
We need write access to the $HOME/.config/exercism/ directory for `exercism config` and $HOME/exercism is the default download directory so we need write access there as well.

This should resolve issue #945
ekingery added a commit that referenced this issue Feb 9, 2021
…n installed as a Snap (#980)

* Allow read-write access to configuration and download directories.

We need write access to the $HOME/.config/exercism/ directory for `exercism config` and $HOME/exercism is the default download directory so we need write access there as well.

This should resolve issue #945

* Permit writes to any files in user's home directory

Authored-by: Richard Neish <[email protected]>
@ekingery
Copy link
Contributor

ekingery commented Feb 9, 2021

This should be resolved by #980 as of the next snap release (which will likely correspond with the Exercism V3 launch). Thanks again, @richardneish!

@ekingery ekingery closed this as completed Feb 9, 2021
@JonasOlson
Copy link

Whatever happened to the solution referred to here? I can't see that it ever made it into the master branch.

For what it's worth, the problem seems to persist in version 3.0.13, installed on Ubuntu using Snap.

@Llcoolsouder
Copy link
Author

Llcoolsouder commented Aug 14, 2021

@JonasOlson

This should be resolved by #980 as of the next snap release (which will likely correspond with the Exercism V3 launch). Thanks again, @richardneish!

It looks like the Snap package hasn't been updated since October 2019, but Exercism v3 is set to roll out in a few weeks so I imagine we will be seeing this resolution very soon.

@JonasOlson
Copy link

@Llcoolsouder

It looks like the Snap package hasn't been updated since October 2019, but Exercism v3 is set to roll out in a few weeks so I imagine we will be seeing this resolution very soon.

Oh, so what we have now is not Exercism v3? I thought it was, based on the version reply from the command-line tool:

$ exercism version
exercism version 3.0.13

@SleeplessByte
Copy link
Member

Exercism V3 as in the platform (https://countdown.exercism.io), not Exercism V3 the CLI tool (even though that, finally, will be upgraded as well 👍🏽)

@jangroth
Copy link

I'm facing the same issue on Ubuntu 20.04 after installing from snap. As a workaround I've installed from source code:.

sudo snap remove exercism
...
cd ~/Downloads
tar xvf exercism-linux-64bit.tgz
mv exercism ~/.local/bin
exercism configure --token=[token]
exercism configure -w /data/dev/Projects/exercism
exercism download --exercise=hello-world --track=typescript

This runs without failing. Obviously not ideal as this solution misses out on automated updates of the binary.

@kotp
Copy link
Member

kotp commented Nov 14, 2021

The manual install works just fine, the snap install is buggy at best, broken at worst.

The recommendation for Linux install is to download the executable and place it in the path, then follow the instructions for the token, demonstrated above by @jangroth.

@anubhavjaiswal03
Copy link

I faced the same issue; it turns out my .config directory had a root ownership.

  1. So I took back the ownership with this command : sudo chown -R $USER /Users/$USER
  2. I re-installed exercism with this command : brew reinstall exercism
  3. That fixed the problem as I could configure the CLI with this : exercism configure --token=

can be found under Setting, in the API/CLI tab in the exercism website.

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

9 participants