kinu-garage / hut_10sqft

Computer setup tools for my own environment, and public discussion place holder.
2 stars 1 forks source link

SUCO: `FileNotFoundError: At '/root/.config/hut_10sqft', a local repo is expected to be present in order to continue.` #1094

Closed 130s closed 1 month ago

130s commented 1 month ago
Full log on c13-morph ``` # export INITOS=/tmp/hut_10sqft_os-setup.py && \ export VERSION=develop && \ export HOST_NAME=130s-C13-Morph && \ export OSTYPE=ChromeOS && \ export USERID=n130s && \ apt update && apt install -y curl python3 && \ curl --output $INITOS https://raw.githubusercontent.com/kinu-garage/hut_10sqft/$VERSION/hut_10sqft/src/hut_10sqft/init_setup.py && \ chmod 755 $INITOS && \ $INITOS --hostname $HOST_NAME --os $OSTYPE --user_id $USERID Hit:1 http://deb.debian.org/debian bullseye InRelease Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease Hit:3 http://deb.debian.org/debian bullseye-updates InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done 8 packages can be upgraded. Run 'apt list --upgradable' to see them. Reading package lists... Done Building dependency tree... Done Reading state information... Done curl is already the newest version (7.74.0-1.3+deb11u13). python3 is already the newest version (3.9.2-3). 0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded. [69/217] % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 43061 100 43061 0 0 393k 0 --:--:-- --:--:-- --:--:-- 393k This module isn't available at the moment but will be installed later. No module named 'apt' This module isn't available at the moment but will be installed later. No module named 'git' args: Namespace(hostname='130s-C13-Morph', msg_endroll=None, os='ChromeOS', path_base_conf='/root/.config', path_local_conf_repo='/root/.config/hut_10sqft', path_conf_dir='hut_10sqft/config ', path_symlinks_dir='link', user_id='n130s') If 'user_id' is not passed, get the user id of the current process. If 'hostname' is not passed, get the host name from the OS. Update the host name as '130s-C13-Morph' Installing by apt: ['python3-git'] subprocess: About to execute the cmd: apt update subprocess: About to execute the cmd: apt update If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'apt update']. Retry now. If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'apt update']. Retry now. output: Hit:1 http://deb.debian.org/debian bullseye InRelease Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease Hit:3 http://deb.debian.org/debian bullseye-updates InRelease Reading package lists... Building dependency tree... Reading state information... 8 packages can be upgraded. Run 'apt list --upgradable' to see them., error: WARNING: apt does not have a stable CLI interface. Use with caution in scripts., bash_return_code: 0 output: Hit:1 http://deb.debian.org/debian bullseye InRelease Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease Hit:3 http://deb.debian.org/debian bullseye-updates InRelease Reading package lists... Building dependency tree... Reading state information... 8 packages can be upgraded. Run 'apt list --upgradable' to see them., error: WARNING: apt does not have a stable CLI interface. Use with caution in scripts., bash_return_code: 0 subprocess: About to execute the cmd: apt install -y python3-git[35/217] subprocess: About to execute the cmd: apt install -y python3-git subprocess: About to execute the cmd: apt install -y python3-git If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'DEBIAN_FRONTEND=noninteractive', 'apt install -y python3-git']. Retry now. If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'DEBIAN_FRONTEND=noninteractive', 'apt install -y python3-git']. Retry now. If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'DEBIAN_FRONTEND=noninteractive', 'apt install -y python3-git']. Retry now. output: , error: , bash_return_code: 0 output: , error: , bash_return_code: 0 output: , error: , bash_return_code: 0 subprocess: About to execute the cmd: apt-cache policy python3-git subprocess: About to execute the cmd: apt-cache policy python3-git subprocess: About to execute the cmd: apt-cache policy python3-git subprocess: About to execute the cmd: apt-cache policy python3-git output: python3-git: Installed: (none) Candidate: 3.1.14-1 Version table: 3.1.14-1 500 500 http://deb.debian.org/debian bullseye/main amd64 Packages, error: , bash_return_code: 0 output: python3-git: Installed: (none) Candidate: 3.1.14-1 Version table: 3.1.14-1 500 500 http://deb.debian.org/debian bullseye/main amd64 Packages, error: , bash_return_code: 0 output: python3-git: Installed: (none) Candidate: 3.1.14-1 Version table: 3.1.14-1 500 500 http://deb.debian.org/debian bullseye/main amd64 Packages, error: , bash_return_code: 0 /tmp/hut_10sqft_os-setup.py:161: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead logger.warn("No pip pkgs requested to be installed, so skpping.") No pip pkgs requested to be installed, so skpping. No pip pkgs requested to be installed, so skpping. No pip pkgs requested to be installed, so skpping. No pip pkgs requested to be installed, so skpping. No pip pkgs requested to be installed, so skpping. _abs_path_repo_cloned_into: /root/.config/hut_10sqft Cloning 'https://github.com/kinu-garage/hut_10sqft.git' into a local dir: '/root/.config/hut_10sqft' so the abs local path will be '/root/.config/hut_10sqft/hut_10sqft. subprocess: About to execute the cmd: git clone https://github.com/kinu-garage/hut_10sqft.git /root/.config/hut_10sqft subprocess: About to execute the cmd: git clone https://github.com/kinu-garage/hut_10sqft.git /root/.config/hut_10sqft subprocess: About to execute the cmd: git clone https://github.com/kinu-garage/hut_10sqft.git /root/.config/hut_10sqft subprocess: About to execute the cmd: git clone https://github.com/kinu-garage/hut_10sqft.git /root/.config/hut_10sqft subprocess: About to execute the cmd: git clone https://github.com/kinu-garage/hut_10sqft.git /root/.config/hut_10sqft subprocess: About to execute the cmd: git clone https://github.com/kinu-garage/hut_10sqft.git /root/.config/hut_10sqft /bin/sh: 1: git: not found output: None, error: None, bash_return_code: 127 output: None, error: None, bash_return_code: 127 output: None, error: None, bash_return_code: 127 output: None, error: None, bash_return_code: 127 output: None, error: None, bash_return_code: 127 output: None, error: None, bash_return_code: 127 Traceback (most recent call last): File "/tmp/hut_10sqft_os-setup.py", line 986, in comp_setup.main() File "/tmp/hut_10sqft_os-setup.py", line 975, in main _os_builder.run(_args, File "/tmp/hut_10sqft_os-setup.py", line 718, in run self.clone(conf_repo_remote, _abs_path_repo_cloned_into) File "/tmp/hut_10sqft_os-setup.py", line 487, in clone raise FileNotFoundError( FileNotFoundError: At '/root/.config/hut_10sqft', a local repo 'https://github.com/kinu-garage/hut_10sqft.git' is expected to be present in order to continue. ```
130s commented 1 month ago

Tracking down the cause of the issue.

  1. git clone failed.
  2. git not available on bash.
  3. apt install -y python3-git finishes w/o error, but immediately after that, apt-cache says the pkg in question is NOT installed.
    Update the host name as '130s-C13-Morph'          
    Installing by apt: ['python3-git']                
    subprocess: About to execute the cmd: apt update  
    subprocess: About to execute the cmd: apt update  
    If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'apt update']. Retry now.
    If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'apt update']. Retry now.  
    output: Hit:1 http://deb.debian.org/debian bullseye InRelease       
    Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease     
    Hit:3 http://deb.debian.org/debian bullseye-updates InRelease       
    Reading package lists...    
    Building dependency tree... 
    Reading state information...
    8 packages can be upgraded. Run 'apt list --upgradable' to see them., error: 
    WARNING: apt does not have a stable CLI interface. Use with caution in scripts., bash_return_code: 0
    output: Hit:1 http://deb.debian.org/debian bullseye InRelease
    Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease
    Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
    Reading package lists...
    Building dependency tree...     
    Reading state information...      
    8 packages can be upgraded. Run 'apt list --upgradable' to see them., error: 
    WARNING: apt does not have a stable CLI interface. Use with caution in scripts., bash_return_code: 0
    subprocess: About to execute the cmd: apt install -y python3-git
    subprocess: About to execute the cmd: apt install -y python3-git
    subprocess: About to execute the cmd: apt install -y python3-git
    If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'DEBIAN_FRONTEND=noninteractive', 'apt install -y python3-git']. Retry now.
    If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'DEBIAN_FRONTEND=noninteractive', 'apt install -y python3-git']. Retry now.
    If 'sudo' is not found on this env, remove that from the command set. New command: ['/bin/sh', '-c', 'DEBIAN_FRONTEND=noninteractive', 'apt install -y python3-git']. Retry now.
    output: , error: , bash_return_code: 0      
    output: , error: , bash_return_code: 0
    output: , error: , bash_return_code: 0
    subprocess: About to execute the cmd: apt-cache policy python3-git
    subprocess: About to execute the cmd: apt-cache policy python3-git
    subprocess: About to execute the cmd: apt-cache policy python3-git
    subprocess: About to execute the cmd: apt-cache policy python3-git
    output: python3-git:
     Installed: (none)
     Candidate: 3.1.14-1
     Version table: 3.1.14-1 500
    500 http://deb.debian.org/debian bullseye/main amd64 Packages, error: , bash_return_code: 0

So I think apt install is suspicious.

130s commented 1 month ago

Found the culprit though I'm not yet sure how to resolve.

_subproc = subprocess.Popen(['/bin/sh', '-c', 'DEBIAN_FRONTEND=noninteractive', 'apt install -y python3-git'])

This immediately returns, without doint much/anything.

_subproc = subprocess.Popen(['/bin/sh', '-c', 'apt install -y python3-git'])

Removing that clause would bring back the issue https://github.com/kinu-garage/hut_10sqft/pull/1081#issuecomment-2334335301.

130s commented 1 month ago
_subproc = subprocess.Popen(['/bin/sh', '-c', 'DEBIAN_FRONTEND=noninteractive apt install -y python3-git'])

Combining a variable and the command as a single string seems to be working.