obelisk icon indicating copy to clipboard operation
obelisk copied to clipboard

nix-build, ob deploy runs out of space

Open johnny555 opened this issue 3 years ago • 2 comments

Hi, I'm trying to deploy obelisk and I've run into an out of space error. I've tracked it down to when nix-build happens and I can reproduce it with

nix-build -A exe --no-out-link --show-trace

building '/nix/store/b6xjzaabl82ycajh0142fd7rfm0cl2h6-obelisk-generated-static-0-js-unknown-ghcjs.drv'...

error: while evaluating the attribute 'buildCommand' of the derivation 'serverExe' at /nix/store/bblbjmnzbzfib5q0r7xbk1c920bsabbw-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'args' of the derivation 'toPath' at /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:178:7:
while evaluating the attribute 'builder' at /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:182:7:
while evaluating 'pairsToBashArray' at /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:173:26, called from /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:174:15:
while evaluating 'mapSnds' at /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:95:14, called from /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:174:33:
while evaluating 'zipListsWith' at /nix/store/bblbjmnzbzfib5q0r7xbk1c920bsabbw-source/lib/lists.nix:369:5, called from /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:95:17:
while evaluating 'min' at /nix/store/bblbjmnzbzfib5q0r7xbk1c920bsabbw-source/lib/trivial.nix:175:12, called from /nix/store/bblbjmnzbzfib5q0r7xbk1c920bsabbw-source/lib/lists.nix:371:45:
while evaluating 'mapAttrsToList' at /nix/store/bblbjmnzbzfib5q0r7xbk1c920bsabbw-source/lib/attrsets.nix:233:23, called from /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:174:65:
while evaluating 'unionMapFilesWithName' at /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:129:28, called from /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:268:41:
while evaluating 'mapAttrsToList' at /nix/store/bblbjmnzbzfib5q0r7xbk1c920bsabbw-source/lib/attrsets.nix:233:23, called from /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:140:58:
while evaluating 'readDirRecursive' at /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:145:20, called from /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:268:84:
while evaluating 'filterAttrs' at /nix/store/bblbjmnzbzfib5q0r7xbk1c920bsabbw-source/lib/attrsets.nix:124:23, called from /nix/store/fk1pqfl3qv5r5jaf0lq1xzxnlzj13b2q-source/lib/asset/assets.nix:146:11:
writing to file: No space left on device

The static folder just contains a few files, no sub directories and none of them are sim-links. So I don't know what is wrong.

johnny555 avatar Mar 28 '21 08:03 johnny555

I encounter this issue as well. You can try revering version back to 11beb6e8cd2419b2429925b76a98f24035e40985 to workaround this issue (even though it works for me, I can't tell if this revision is fine or simply because I have certain binary cache).

You can do this by modifying .obelisk/impl/github.json to

{
  "owner": "obsidiansystems",
  "repo": "obelisk",
  "branch": "master",
  "private": false,
  "rev": "11beb6e8cd2419b2429925b76a98f24035e40985",
  "sha256": "0b4m33b7yyzsbkvfz2kwg4v9hlnvbjlmjikbvwd7pg52vy84and0"
}

TheKK avatar May 13 '21 05:05 TheKK

Not sure if related:

I just got "no space left on device" when trying to deploy to an aws ec2 instance (building locally via nix-build works fine). I had this before. I ssh'd into the instance and ran nix-collect-garbage -d, which deleted 4.8 GB of data. This alone seems excessive -- no clue why my project would need so much ever. Also, this garbage collection could be an automated part of deployment, or even more: when I deploy, I don't rely on any data that is still stored on the instance - it just should be wiped.

rubenmoor avatar Mar 16 '23 22:03 rubenmoor