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

Permission denied on .slack-term #138

Open
shyamsathyanathan opened this issue Apr 30, 2018 · 13 comments
Open

Permission denied on .slack-term #138

shyamsathyanathan opened this issue Apr 30, 2018 · 13 comments
Labels

Comments

@shyamsathyanathan
Copy link

shyamsathyanathan commented Apr 30, 2018

I have made a fresh installation of slack-term from Ubuntu-18.04 GNOME Software. I have also created the .slack-term file in my home directory as shown on the README. But whenever I try to launch the application from terminal, I get this

couldn't find the slack-term config file: open /home/shyam/.slack-term: permission denied

However,

~ 
➜ pwd
/home/shyam
~ 
➜ ls -l .slack-term 
-rwxrwxrwx 1 shyam shyam 1815 Apr 30 10:42 .slack-term

Note: the permissions have been edited by me to 777 just to make sure that this isn't actually a permission issue at all.

I have also edited the file to add my token and removed all the comments to make sure that it is a valid JSON. (Even if this was indeed the problem, the error thrown is unclear)

@Kehet
Copy link

Kehet commented May 16, 2018

If you installed slack-term using GNOME Software, config directory seems to be $HOME/snap/slack-term/current/slack-term.json, you can launch program using slack-term --config $HOME/snap/slack-term/current/slack-term.json. This probably has something to do with snap sandboxing..

@fidlip
Copy link

fidlip commented May 16, 2018

The same problem in my case. This should be "bug" not "question". Also in my case this is NOT problem of permissions.
Content of my config file:
{ "slack_token": "***************************************" }
Even if I manually select path to file there is no change:
slack-term -config /home/fidlip/.slack-term
When I run it as root with sudo, no difference.

My system: Ubuntu 18.04

@fidlip
Copy link

fidlip commented May 16, 2018

I realized now, it is problem of Ubuntu package. If I download binary from github, It seem to be OK...

@popey
Copy link
Contributor

popey commented May 16, 2018

Yup. The sandboxing means slack-term snap has access to limited directories. As @Kehet points out running slack-term --config $HOME/snap/slack-term/current/slack-term.json and keeping your config files there works fine. I use this for multiple slacks.

@shyamsathyanathan
Copy link
Author

@fidlip It would be a good idea to remove your slack token from here and get a new one.

@fidlip
Copy link

fidlip commented May 17, 2018

Good point, thanks

@dbdennis
Copy link

Hi: this problem persists, I'm afraid. Downloaded from github, but experiencing same, no matter which of strategies suggested above. [Ubuntu 18.04]

@fidlip
Copy link

fidlip commented May 19, 2018

What is full path of your configuration file?

@dbdennis
Copy link

Sorry for the delayed response:
home/name/.slack-term

@spuyet
Copy link

spuyet commented Jul 7, 2018

I think this is confusing for people using snap to install slack-term. Maybe that we should update snapcraft.yml file to improve clarity or add a note in the Readme Setup section. WDYT @erroneousboat ?

@popey
Copy link
Contributor

popey commented Jul 7, 2018

@dbdennis see my comment above. Your config file should be $HOME/snap/slack-term/current/slack-term.json (or something else in $HOME/snap/slack-term/current/. Then launch with slack-term --config $HOME/snap/slack-term/current/slack-term.json

@terabyte
Copy link

For anyone else experiencing this problem, I was hoping to produce an easy step-by-step process to see what is going on and help debug. Here is what I came up with... I invoked slack-term from the command line using strace as follows to debug further:

$ sudo apt-get install strace
Reading package lists... Done
Building dependency tree       
Reading state information... Done
strace is already the newest version (4.15-2).
The following packages were automatically installed and are no longer required:
  libgsoap7 libpng12-0 libqt4-opengl libvncserver1 libvpx3
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 173 not upgraded.
$ chmod 000 ~/.slack-term
$ strace -f -o strace-slack-term.log ~/projects/gopath/bin/slack-term
<if slack-term doesn't quit on its own, exit it>
$ egrep '\.slack-term' strace-slack-term.log
32451 openat(AT_FDCWD, "/home/cmyers/.slack-term", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
$ chmod 400 ~/.slack-term
$ strace -f -o strace-slack-term.log ~/projects/gopath/bin/slack-term
<if slack-term doesn't quit on its own, exit it>
$ egrep '\.slack-term' strace-slack-term.log
31239 openat(AT_FDCWD, "/home/cmyers/.slack-term", O_RDONLY|O_CLOEXEC) = 6

"openat" is the api slack-term uses to try to open your slack-term file. You can see the exact path it is trying to read, in my case, "/home/cmyers/.slack-term". The first time, you can see it gets permission denied (-1 EACCESS), the second time it works correctly (because I fixed the permissions).

I'm hoping the above steps will help folks determine what is going on themselves more easily.

@lordvader501
Copy link

I have made a fresh installation of slack-term from Ubuntu-18.04 GNOME Software. I have also created the .slack-term file in my home directory as shown on the README. But whenever I try to launch the application from terminal, I get this

couldn't find the slack-term config file: open /home/shyam/.slack-term: permission denied

However,

~ 
➜ pwd
/home/shyam
~ 
➜ ls -l .slack-term 
-rwxrwxrwx 1 shyam shyam 1815 Apr 30 10:42 .slack-term

Note: the permissions have been edited by me to 777 just to make sure that this isn't actually a permission issue at all.

I have also edited the file to add my token and removed all the comments to make sure that it is a valid JSON. (Even if this was indeed the problem, the error thrown is unclear)

lordvader@lordvader:~$ slack-term
2020/01/23 15:14:26 couldn't find the slack-term config file: open /home/lordvader/.slack-term: permission denied

lordvader@lordvader:~$ pwd
/home/lordvader

lordvader@lordvader:~$ ls -l .slack-term
-rw-rw-rw- 1 lordvader lordvader 0 Jan 23 14:52 .slack-term

help how to fix it

@jpbruinsslot jpbruinsslot pinned this issue Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants