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

vmware-image: ERROR: cptofs failed. diskSize might be too small for closure #263676

Closed
Pablo1107 opened this issue Oct 27, 2023 · 3 comments
Closed

Comments

@Pablo1107
Copy link
Contributor

Describe the bug

Cannot build a NixOS vmware image, it throws the error in the title.

Steps To Reproduce

  1. Write this files:

flake.nix

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
  };

  outputs = { self, nixpkgs }@inputs:
    {
      nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          "${nixpkgs}/nixos/modules/virtualisation/vmware-image.nix"
          ./hosts/vm/nixos.nix
          {
            config = {
              vmware.baseImageSize = 32 * 1024;
            };
          }
        ];
      };
    };
}

nixos.nix

{ config, pkgs, lib, ... }:

{
  networking = {
    hostName = "vm";
    wireless = {
      enable = true;
      networks."xxxx".psk = "xxxx";
      interfaces = [ "wlan0" ];
    };
  };

  environment.systemPackages = with pkgs; [ firefox ];

  services.xserver = {
    enable = true;
    desktopManager = {
      xterm.enable = false;
      xfce.enable = true;
    };
    displayManager.defaultSession = "xfce";
  };

  users = {
    mutableUsers = false;
    users.xxxx = {
      isNormalUser = true;
      extraGroups = [ "wheel" ];
      hashedPassword = "xxxx";
    };
  };

  nix.settings.trusted-users = [ "root" "xxxx" ];

  # hardware.enableRedistributableFirmware = true;
  system.stateVersion = "23.11";
}
  1. Run this command
nix build .#nixosConfigurations.vm.config.system.build.vmwareImage
  1. Get this error
ERROR: cptofs failed. diskSize might be too small for closure.
error: builder for '/nix/store/a4csb9lalv9ii4yzmzi9ihngngpd6bzj-nixos-vmware-23.11pre-git-x86_64-linux.drv' failed with exit code 1;
       last 10 log lines:
       > error processing entry /build/root/nix/store/q7fz2i5z235wjy8ajsf1wh25mmbj5r97-nixos-23.11pre-git/nixos/pkgs/servers, aborting
       > error processing entry /build/root/nix/store/q7fz2i5z235wjy8ajsf1wh25mmbj5r97-nixos-23.11pre-git/nixos/pkgs, aborting
       > error processing entry /build/root/nix/store/q7fz2i5z235wjy8ajsf1wh25mmbj5r97-nixos-23.11pre-git/nixos, aborting
       > error processing entry /build/root/nix/store/q7fz2i5z235wjy8ajsf1wh25mmbj5r97-nixos-23.11pre-git, aborting
       > error processing entry /build/root/nix/store, aborting
       > error processing entry /build/root/nix, aborting
       > [   39.059236] EXT4-fs (vda2): Remounting filesystem read-only
       > [   39.059279] EXT4-fs (vda2): ext4_writepages: jbd2_start: 9223372036854775807 pages, ino 29336; err -30
       > [   39.082975] reboot: Restarting system
       > ERROR: cptofs failed. diskSize might be too small for closure.
       For full logs, run 'nix-store -l /nix/store/a4csb9lalv9ii4yzmzi9ihngngpd6bzj-nixos-vmware-23.11pre-git-x86_64-linux.drv'.
       note: build failure may have been caused by lack of free disk space

Expected behavior

This should output a vmware image and not throw an error based on lack of disk space. I have >100GB of free space and even if I increase the diskSize it throws anyway. "auto" same result.

Notify maintainers

@evanjs

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.5.5-arch1-1, Arch Linux, noversion, rolling`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(pablo): `"home-manager"`
 - channels(root): `"nixos-20.09, nixpkgs"`
 - nixpkgs: `/nix/store/zl0r71l8kh94rs8r7894nna53z7wpw24-source`
@Lassulus
Copy link
Member

do you have /tmp on a tmpfs? if yes that is probably running full? or maybe the VM is running out of memory

@Pablo1107
Copy link
Contributor Author

do you have /tmp on a tmpfs? if yes that is probably running full? or maybe the VM is running out of memory

No, it's not. But in the linked issue some think it may be resolved by nix-community/nixos-generators#292

@Pablo1107
Copy link
Contributor Author

Cannot reproduce anymore. I tried just now and it build successfully. Closing.

(thanks @samueldr for the idea)

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

2 participants