morph icon indicating copy to clipboard operation
morph copied to clipboard

Nix build failing (exit 1) without erroring?

Open diamondburned opened this issue 6 years ago • 5 comments

I was trying to deploy this over GitLab's CI using morph, but morph keeps failing. Here's the CI output: https://0x0.st/zylt.txt

From the output, I can't seem to point out any errors, it just seems like nix-build just exited 1 for whatever reason. How do I debug?

CI:

image: nixos/nix

variables:
  SSH_SKIP_HOST_KEY_CHECK: "1"

morph:
  cache:
    key: nix
    paths:
      - .nix/
  before_script:
    # Different /nix/store path
    - mkdir -p "$PWD/.nix"
    - mv -f /nix/* "$PWD/.nix/"
    - mount -o bind "$PWD/.nix" /nix
    # Add the stable channel and update
    - nix-channel --add https://nixos.org/channels/nixos-unstable nixos
    - nix-channel --update
    # Install dependencies
    - nix-env -iA nixos.git nixos.gnutar
    - nix-env -iA nixos.morph nixos.openssh
    # Change the permission of the private key so SSH can be happy
    - chown root "$SSH_IDENTITY_FILE"
    - chmod 600 "$SSH_IDENTITY_FILE"
  script:
    - export GIT_SSH_COMMAND="ssh -i $SSH_IDENTITY_FILE -o StrictHostKeyChecking=no"
    #- morph build default.nix
    #- morph deploy default.nix test
    - morph deploy default.nix switch

morph version: 1.3.0 from NixOS Unstable

pkgs is from

    pkgs = import (builtins.fetchGit {
        url = "https://github.com/NixOS/nixpkgs-channels.git";
        ref = "nixos-19.09";
        rev = "64e38f246aebc1fcd800952322c08f92d1420660";
    }) {};

diamondburned avatar Sep 17 '19 05:09 diamondburned

This does not happen with nixos-unstable, everything builds perfectly fine:

let
	pkgs = import (builtins.fetchGit {
		url = "https://github.com/NixOS/nixpkgs-channels.git";
		ref = "nixos-unstable";
		rev = "e19054ab3cd5b7cc9a01d0efc71c8fe310541065";
	}) {};

diamondburned avatar Sep 17 '19 06:09 diamondburned

New error with nixos-19.09:

error: attribute 'overlays' missing, at /tmp/morph-388782134/eval-machines.nix:39:50
(use '--show-trace' to show detailed location information)
Error while running `nix build ...`: See above.
let
    pkgs = import (builtins.fetchGit {
        url = "https://github.com/NixOS/nixpkgs-channels.git";
        ref = "nixos-19.09";
        rev = "64e38f246aebc1fcd800952322c08f92d1420660";
    }) {};

diamondburned avatar Sep 17 '19 06:09 diamondburned

New error with nixos-19.03:

let
    pkgs = import (builtins.fetchGit {
        url = "https://github.com/NixOS/nixpkgs-channels.git";
        ref = "nixos-19.03";
        rev = "2dfae8e22fde5032419c3027964c406508332974";
    }) {};

Imports:

		imports = [
			<nixpkgs/nixos/modules/virtualisation/amazon-image.nix>
			"${home-manager}/nixos"
			./packages/shihoya-api/service.nix
		];

diamondburned avatar Sep 17 '19 06:09 diamondburned

@diamondburned sorry for the astonishing lack of feedback here. But.. I dare now to break the silence.

Is this issue still relevant? I feel that since v1.3.0 we've improved the output of morph, as well as the joining of morph sub-threads. Have you experienced any similar issues since?

johanot avatar May 13 '20 19:05 johanot

Unfortunately I can't test this anymore, but if I recall correctly then the issue was caused by the <> imports using my local channel.

diamondburned avatar May 13 '20 22:05 diamondburned