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

nixops ssh is broken on Mac: database disk image is malformed #1035

Closed
coretemp opened this issue Nov 1, 2018 · 4 comments
Closed

nixops ssh is broken on Mac: database disk image is malformed #1035

coretemp opened this issue Nov 1, 2018 · 4 comments

Comments

@coretemp
Copy link

coretemp commented Nov 1, 2018

When I try to run

nixops ssh -s state.nixops --deployment d machine -F /dev/null

where nixops is the master (4d8a49e) version of nixops on a Mac 10.13.6.

I get

Traceback (most recent call last):
  File "/nix/store/9v1hri5laa7dd54lz5k33dnnl5pmrz7r-nixops-1.6.1pre0_abcdef/bin/.nixops-wrapped", line 990, in <module>
    args.op()
  File "/nix/store/9v1hri5laa7dd54lz5k33dnnl5pmrz7r-nixops-1.6.1pre0_abcdef/bin/.nixops-wrapped", line 561, in op_ssh
    allow_ssh_args=True, user=user))
  File "/nix/store/9v1hri5laa7dd54lz5k33dnnl5pmrz7r-nixops-1.6.1pre0_abcdef/lib/python2.7/site-packages/nixops/ssh_util.py", line 280, in run_command
    master = self.get_master(flags, timeout, user)
  File "/nix/store/9v1hri5laa7dd54lz5k33dnnl5pmrz7r-nixops-1.6.1pre0_abcdef/lib/python2.7/site-packages/nixops/ssh_util.py", line 190, in get_master
    if self._host_fun() == "localhost":
  File "/nix/store/9v1hri5laa7dd54lz5k33dnnl5pmrz7r-nixops-1.6.1pre0_abcdef/lib/python2.7/site-packages/nixops/backends/ec2.py", line 172, in get_ssh_name
    if not self.private_ipv4:
  File "/nix/store/9v1hri5laa7dd54lz5k33dnnl5pmrz7r-nixops-1.6.1pre0_abcdef/lib/python2.7/site-packages/nixops/util.py", line 245, in get
    s = self._get_attr(name, default)
  File "/nix/store/9v1hri5laa7dd54lz5k33dnnl5pmrz7r-nixops-1.6.1pre0_abcdef/lib/python2.7/site-packages/nixops/resources/__init__.py", line 91, in _get_attr
    c.execute("select value from ResourceAttrs where machine = ? and name = ?", (self.id, name))
pysqlite2.dbapi2.DatabaseError: database disk image is malformed

Using the same nixops state file on Linux with the same master version does work (it logs me in to the machine via ssh).

@coretemp
Copy link
Author

coretemp commented Nov 2, 2018

When running /usr/bin/sqlite3 state.ops and then typing PRAGMA integrity_check;,:

*** in database main ***
Page 26: btreeInitPage() returns error code 11
On tree page 9 cell 5: Rowid 38624 out of order
On tree page 25 cell 40: Rowid 40477 out of order
On tree page 25 cell 0: Rowid 39359 out of order
Page 24: btreeInitPage() returns error code 11
Page 28 is never used
Page 32 is never used
Error: database disk image is malformed

The Mac sqlite3 version is different, however, but I assume the version of the library being used by nixops in the right one.

3.19.3 2017-06-27 16:48:08 2b0954060fe10d6de6d479287dd88890f1bef6cc1beca11bc6cdb79f72e2377b

Doing the same with the exact same file on Linux returns:

ok

@coretemp
Copy link
Author

coretemp commented Nov 2, 2018

When using sqlite3 3.22.0 inside a Nix based docker image on that Mac returns a similar corruption.

@wmertens
Copy link
Contributor

wmertens commented May 7, 2019

This is a duplicate of #1036 I suppose. The error you have can not occur with normal use of sqlite through the client libraries (there's billions of installations that work fine), so you either have a hardware issue, or a macOS filesystem bug (not impossible), or maybe there's something messing with the db files?

@wmertens
Copy link
Contributor

wmertens commented May 7, 2019

how are you using the docker image with nixops? SQLite is not happy on networked storage.

@grahamc grahamc closed this as completed Apr 20, 2020
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