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

Bug Unable to compile - fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. #2426

Closed
dieselee opened this issue Dec 7, 2024 · 18 comments
Labels
Bug Identifies an issue where the system is not functioning as expected. Compiling For issues specifically related to compilation errors.
Milestone

Comments

@dieselee
Copy link

dieselee commented Dec 7, 2024

TFT Version

No response

Firmware Version

No response

Blueprint Version

No response

Panel Model

None

What is the bug?

Hi im unable to compile is this an external issue or local?

INFO ESPHome 2024.11.3
INFO Reading configuration /config/esphome/ns-panel.yaml...
Failed config

external_components: [source /data/packages/566b10a3/esphome/nspanel_esphome_core.yaml:40]

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'.
source: 
  type: git
  url: https://github.com/Blackymas/NSPanel_HA_Blueprint
  ref: v4.3.12
components: 
  - nspanel_ha_blueprint
refresh: 30s

Steps to Reproduce

No response

Your Panel's YAML

No response

ESPHome Logs

No response

Home Assistant Logs

No response

@dieselee dieselee added the Bug Identifies an issue where the system is not functioning as expected. label Dec 7, 2024
@dieselee dieselee changed the title Bug Unable to compile Bug Unable to compile - fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Dec 7, 2024
@edwardtfn
Copy link
Collaborator

edwardtfn commented Dec 7, 2024

Have you tried cleaning the build files?

@dieselee
Copy link
Author

dieselee commented Dec 7, 2024

Have you tried cleaning the build files?

Yes it appears to give the same error

Clean ns-panel.yaml
INFO ESPHome 2024.11.3
INFO Reading configuration /config/esphome/ns-panel.yaml...
INFO Updating https://github.com/Blackymas/NSPanel_HA_Blueprint@main
Failed config

external_components: [source /data/packages/566b10a3/esphome/nspanel_esphome_core.yaml:40]

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'.
source: 
  type: git
  url: https://github.com/Blackymas/NSPanel_HA_Blueprint
  ref: v4.3.12
components: 
  - nspanel_ha_blueprint
refresh: 30s

@tomatenkopp
Copy link

same here with ESPHome 2024.12.x had to downgrade ESPHome to 2024.11.3
ESP throws the "ambiguous HEAD" error even in the config editor of the device.

Looks like the config syntax has to be changed, please check and update the config example here, thanks!

@edwardtfn
Copy link
Collaborator

The tag v4.3.12 is there and all looks good, so I don't understand this issue.
I've just created a branch with this same name, pointing to the same place. Could you please try again?

@edwardtfn edwardtfn added this to the v4.4.0 milestone Dec 20, 2024
@edwardtfn edwardtfn added the Compiling For issues specifically related to compilation errors. label Dec 20, 2024
@dieselee
Copy link
Author

Same error for me ESP Home has had update since the last time i tried to complile as well to 2024.12.1

Clean ns-panel.yaml
INFO ESPHome 2024.12.1
INFO Reading configuration /config/esphome/ns-panel.yaml...
Failed config

external_components: [source /data/packages/566b10a3/esphome/nspanel_esphome_core.yaml:40]

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'.
source: 
  type: git
  url: https://github.com/Blackymas/NSPanel_HA_Blueprint
  ref: v4.3.12
components: 
  - nspanel_ha_blueprint
refresh: 30s

@edwardtfn
Copy link
Collaborator

Could you please try forcing an earlier version of this project?
I'm your panel's yaml, change from ref: main to ref: v4.3.11.

@dieselee
Copy link
Author

Same error when trying clean build for me with ref: v4.3.11

@edwardtfn
Copy link
Collaborator

May I ask for another test?
What if you create a new ESP32 device in your ESPHome Dashboard, then copy your panel's yaml entirely to this new device, replacing its yaml, just keeping a different name to avoid conflicts...
Do you have the same error when compiling that new one?

@dieselee
Copy link
Author

Ok my apologies, it does compile successfully with ref: v4.3.11

I did try using ref: v4.3.12 and it still has error on that one.

Lee

@edwardtfn
Copy link
Collaborator

Ok, good to know you can use the system with v4.3.11. But I still have no idea why v4.3.12 is failing. 😬
Anyways, the difference is just an unlikely bug fix related to timezone and we probably can come with a work around for that if you face it. ;)
Let's see if v4.4.0 works better when released.

@dieselee
Copy link
Author

Thank you for your support, I will install to the ns-panel 👍

@oolivero45
Copy link

Hi,

I'm having exactly the same issue - trying to use 4.3.11 isn't helping in my case either. Any guidance would be greatly appreciated!

The error I'm getting is exactly the same.

Let me know if there are any logs which would be helpful to attach.

@edwardtfn
Copy link
Collaborator

Could you please share your yaml and the logs for when you are trying v4.3.11?
Please remove any sensitive info before sharing. 😉

@oolivero45
Copy link

oolivero45 commented Dec 24, 2024

YAML:

substitutions:
  # Settings - Editable values
  device_name: "desk-nspanel"
  friendly_name: "Desk NSPanel"
  wifi_ssid: DevNet
  wifi_password: [Redacted]
  nextion_update_url: "http://192.168.1.222/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####
api:
  encryption:
    key: "[Redacted]"
##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: v4.3.11
    refresh: 300s
    files:
      - nspanel_esphome.yaml # Basic package
      # Optional advanced and add-on configurations
      # - esphome/nspanel_esphome_advanced.yaml
      # - esphome/nspanel_esphome_addon_ble_tracker.yaml
      # - esphome/nspanel_esphome_addon_bluetooth_proxy.yaml
      # - esphome/nspanel_esphome_addon_climate_cool.yaml
      - esphome/nspanel_esphome_addon_climate_heat.yaml
      # - esphome/nspanel_esphome_addon_climate_dual.yaml
      # - esphome/nspanel_esphome_addon_cover.yaml

Logs:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/desk-nspanel.yaml...
INFO Detected timezone 'Europe/London'
INFO Generating C++ source...
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/esphome/esphome/__main__.py", line 1036, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1023, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 503, in command_run
    exit_code = write_cpp(config)
                ^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 213, in write_cpp
    return write_cpp_file()
           ^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 231, in write_cpp_file
    writer.write_cpp(code_s)
  File "/esphome/esphome/writer.py", line 341, in write_cpp
    copy_src_tree()
  File "/esphome/esphome/writer.py", line 307, in copy_src_tree
    copy_files()
  File "/esphome/esphome/components/esp32/__init__.py", line 801, in copy_files
    repo_dir, _ = git.clone_or_update(
                  ^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/git.py", line 92, in clone_or_update
    old_sha = run_git_command(["git", "rev-parse", "HEAD"], str(repo_dir))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/git.py", line 32, in run_git_command
    raise cv.Invalid(err_str)
voluptuous.error.Invalid: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

If I swap the ref out for any other version it throws the same error. I'm starting to suspect it's somethign weird going on with ESPHome, rather than with the NSPanel project specifically, at this point, as it seems like it just really does not want to do the git operation properly.

I've tried clearing the build files, with no luck, and I've tried swapping the device running HA out for an 8GB pi rather than the original 4GB one just in case it was running out of memory during compilation.

@oolivero45
Copy link

To further add to this: I'm able to successfully compile it if I do it from the ESPHome CLI running on my main PC, so it appears to be isolated to either the ESPHome HA addon, or my specific installation of it, rather than a general issue?

@oolivero45
Copy link

I've just fully uninstalled ESPHome and reinstalled it, and after some messing around to get it to start installing from scratch again, it seems to be behaving now - but only with 4.3.11. 4.3.12 was still refusing, although I think this was because something was still lingering from the previous install as it was happening far too fast for it to actually be trying to pull the git repo.

Unfortunately I don't know what about the fresh install fixed it - I'm happy to help in any way I can if you still want to try to pin down exactly what was causing it though.

@MichalUngr23
Copy link

Právě jsem plně odinstaloval ESPHome a znovu ji nainstaloval a po nějakém motání se, abych ji znovu začal instalovat od nuly, zdá se, že se nyní chová - ale pouze s 4.3.11. 4.3.12 stále odmítal, i když si myslím, že to bylo proto, že něco stále přetrvávalo z předchozí instalace, protože se to dělo příliš rychle na to, aby se ve skutečnosti snažilo stáhnout git repo.

Bohužel nevím, co opravila čerstvá - rád by vám vyhovoval způsob instalace, pokud se přesto chcete pokusit přesně určit, co to může být.

Jak jsi to prosím vyresil ja odinstaloval doplnek ESPhome a vysledek stejny : INFO ESPHome 2025.1.0-dev
INFO Reading configuration /config/esphome/nspanelblack.yaml...
Failed config

external_components: [source /data/packages/4c136fb8/esphome/nspanel_esphome_core.yaml:40]

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'.
source: 
  type: git
  url: https://github.com/Blackymas/NSPanel_HA_Blueprint
  ref: v4.3.12
components: 
  - nspanel_ha_blueprint
refresh: 30s

@MichalUngr23
Copy link

uz to zacalo fungovat zniceho nic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Identifies an issue where the system is not functioning as expected. Compiling For issues specifically related to compilation errors.
Projects
None yet
Development

No branches or pull requests

5 participants