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

bug: Dropbox service not working on 23.05 #4226

Open
2 tasks done
denibertovic opened this issue Jul 12, 2023 · 8 comments
Open
2 tasks done

bug: Dropbox service not working on 23.05 #4226

denibertovic opened this issue Jul 12, 2023 · 8 comments
Assignees
Labels
bug status: stale triage Issues or feature request that have not been triaged yet

Comments

@denibertovic
Copy link

denibertovic commented Jul 12, 2023

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

The dropbox service fails to start on NixOS 23.05.

Here's are the logs from journalctl: https://gist.github.com/denibertovic/a84301d4f6e5f4d42dae4c7dfc76649c

It seems to me that something happens on line 327 which I think corresponds to this: https://github.com/nix-community/home-manager/blob/master/modules/services/dropbox.nix#L74

Is anyone else having this issue?

Maintainer CC

@eyJhb

System information

~ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 6.1.37, NixOS, 23.05 (Stoat), 23.05.1622.c99004f75fd`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.13.3`
- channels(root): `"home-manager-23.05.tar.gz, nixos-23.05, nixos-unstable"`
- channels(deni): `"home-manager-23.05.tar.gz"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@denibertovic denibertovic added bug triage Issues or feature request that have not been triaged yet labels Jul 12, 2023
@brendanhay
Copy link

brendanhay commented Jul 13, 2023

What do you get running dropbox update?

Probably related: NixOS/nixpkgs#235345 (Oops, I see you already posted there!)

@denibertovic
Copy link
Author

I thought so too. But after commenting on the related issue I did a little digging and I'm not sure it's related anymore.
I found this: #1415

Basically if you set DISPLAY= the error goes away.

So I tried doing:

DISPLAY= dropbox update

What it does, understandably, is download the proprietary package into $HOME/.dropbox-dist, instead of into $HOME/.dropbox-hm/.dropbox-dist.

I tried running $HOME/.dropbox-dist/dropboxd start but that fails with the following error:

/home/deni/.dropbox-dist/dropbox-lnx.x86_64-178.4.4811/dropboxd: line 15: /home/deni/.dropbox-dist/dropbox-lnx.x86_64-178.4.4811/dropbox: cannot execute: required file not found

I think it's because of this:

nix-shell -p file --run 'file /home/deni/.dropbox-dist/dropbox-lnx.x86_64-178.4.4811/dropbox'
/home/deni/.dropbox-dist/dropbox-lnx.x86_64-178.4.4811/dropbox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=d966ae4732ef7898629043bd622560eba1480634, stripped

There is no /lib64/ld-linux-x86-64.so.2. I think I'd have to run that particular $HOME/.dropbox-dist/dropboxd start inside buildFHSEnv but I can't figure out the magic incantation to do that with nix-shell.

@denibertovic
Copy link
Author

@brendanhay Upon closer inspection this might actually be happening with the HM service file as well. I just don't get why the error would be swallowed. Cause I don't see any use of buildFHSEnv anywhere and it's just downloading the .dropbox-dist stuff like I did above.
It's only making sure to set HOME=$HOME/.dropbox-hm to trick into thinking it should download stuff in the self contained .dropbox-hm folder. I fail to see how this worked before at all.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/using-dropbox-on-nixos-23-05/30488/6

@sevillaarvin
Copy link

sevillaarvin commented Aug 20, 2023

I found part of the problem.

problem

If i take a look at the bin/dropbox python file (/nix/store/g2dc33ssd6zj22vgzhcrx656c62xizki-dropbox-cli-2020.03.04/bin/dropbox),
under the function start_dropbox(), line 769-773, we can see that this function returns True when it detects that dropbox is running.

        for _ in range(int(wait_for / interval)):
            if is_dropbox_running():
                return True
            # back off from connect for a while
            time.sleep(interval)

However, the problem is while dropbox is technically running, it's not ready yet.

I added a bunch of print() functions, notably in the __readline() function of the class DropboxCommand()

    def __readline(self):
        try:
            toret = self.f.readline().rstrip("\n")
        except socket.error:
            raise DropboxCommand.BadConnectionError()
        if toret == '':
            raise DropboxCommand.EOFError()
        else:
            print("INFO toret:", toret)
            return toret

When I manually start the modified python3 file,

$ ./dropbox start -i

# various ...
INFO toret: No client link url available yet!
INFO toret: done
# various ...
Done!

We can see that the login url that dropbox is supposed to hand over to a web browser (firefox in my case), is not yet available.

(temporary) solution

However, if we modify the code and add a line to wait for it to prepare the link,

        for _ in range(int(wait_for / interval)):
            if is_dropbox_running():
                time.sleep(5) # <================ THIS RIGHT HERE
                return True
            # back off from connect for a while
            time.sleep(interval)

And run the command again,

$ ./dropbox start -i

# various ...
INFO toret: link_url    https://www.dropbox.com/cli_link_nonce?nonce=<some-nonce-here>
INFO toret: done
# various ...
Done!

We can see that the login link is now available. Firefox also automatically opens the link.

However, I don't know how to patch this yet using nix/nixpkgs ecosystem. Any help is appreciated.

EDIT Nvm I don't think it's relevant. The dropbox service still won't run.

Copy link

stale bot commented Nov 18, 2023

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

@graham33
Copy link
Contributor

graham33 commented Jan 7, 2024

NixOS/nixpkgs#277422 fixed this for me, thanks @tomeon! Would be good to get that merged.

@stale stale bot removed the status: stale label Jan 7, 2024
Copy link

stale bot commented Apr 15, 2024

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

@stale stale bot added the status: stale label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: stale triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

8 participants