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 when mounting Android device #65626

Open
l0b0 opened this issue Jul 31, 2019 · 5 comments
Open

Permission denied when mounting Android device #65626

l0b0 opened this issue Jul 31, 2019 · 5 comments

Comments

@l0b0
Copy link
Contributor

l0b0 commented Jul 31, 2019

Describe the bug
Following the instructions for MTP with jmtpfs results in a "permission denied" error.

To Reproduce
Steps to reproduce the behavior:

  1. Connect a phone via USB.
  2. Answer "OK" to the "Using USB to transfer files?" prompt
  3. Follow the instructions:
    $ nix-env -f "<nixpkgs>" -iA jmtpfs
    installing 'jmtpfs-0.5'
    these paths will be fetched (0.04 MiB download, 0.14 MiB unpacked):
      /nix/store/akv80ighdp17hivl0rvf6r81c5s8jk61-jmtpfs-0.5
    copying path '/nix/store/akv80ighdp17hivl0rvf6r81c5s8jk61-jmtpfs-0.5' from 'https://cache.nixos.org'...
    building '/nix/store/9vi7gvrygwz972cz2j6fgq0fmqln01xk-user-environment.drv'...
    created 1 symlinks in user environment
    $ mkdir mountpoint
    $ jmtpfs mountpoint
    Device 0 (VID=2e04 and PID=c026) is a Nokia 6.1.
    libusb_open() failed!: Permission denied
    LIBMTP PANIC: Unable to initialize device
    terminate called after throwing an instance of 'MtpErrorCantOpenDevice'
      what():  Can't open device
    Aborted
    

Expected behavior
The device should be mounted.

Metadata

$ nix run nixpkgs.nix-info -c nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.58, NixOS, 19.03.173085.ecc64b374b2 (Koi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2.2`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@xaverdh
Copy link
Contributor

xaverdh commented Aug 1, 2019

Putting jmtpfs in environment.systemPackages works for me, but when using nix-shell it fails with the same error.

@l0b0
Copy link
Contributor Author

l0b0 commented Aug 1, 2019

@xaverdh Huh - works for me too doing that. Is it expected that this behaviour should be different, or should we keep this open to deal with that?

@xaverdh
Copy link
Contributor

xaverdh commented Aug 1, 2019

Well its sort of expected, in the sense that some things are known to not work perfectly when using nix-env / nix-shell. But I think the general feeling is that if something can be made to work with nix-shell / nix-env, it should be. So I would keep it open, at least until we know what exactly is causing the difference in behaviour.

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@Pamplemousse
Copy link
Member

I am facing a similar issue, even using the following configuration:

{
  environment.systemPackages = with pkgs; [
    jmtpfs
  ];

  programs = {
    fuse.userAllowOther = true;
  };

  users.groups.fuse = {};
  users.users.${user} = {
    extraGroups = [ "fuse" "wheel" ];
  };
}

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 28, 2023
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