Can't test my addon : Invalid build environment, can't build this add-on!

Hi, I’m new on addon dev homeassistant, I try to Start a python discord bot with a simple addon with some options config “3” and a simple run.sh script.
But I don’t understand a part of an error, HA see my repo and list my custom addon in the addon store but can’t even get it installed and say I should see supervisor log, so I do it and there is my error, can anyone help me understand my problem?

Check my Github repo there :

I paste here my supervisor log :

22-10-31 18:08:55 INFO (MainThread) [supervisor.store] Loading add-ons from store: 296 all - 1 new - 0 remove
22-10-31 18:09:21 INFO (MainThread) [supervisor.addons] Creating Home Assistant add-on data folder /data/addons/data/f9ca086a_discord_bot
22-10-31 18:09:21 ERROR (SyncWorker_0) [supervisor.docker.addon] Invalid build environment, can't build this add-on!

Thanks for helping me :wink:

I forgot to say something, when my addon seems to start correctly my personal bot and other, I will make my addon more flexible for a public usage, like some community addon now.
But only if my bot start like on my terminal session.
Thanks.

I’m not really sure. Maybe try changing supervisor’s log level to debug (ha supervisor options --logging debug) and then try again to see if you can get some more insight? Also can you share your system info?

Got this now :

22-10-31 18:50:49 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token

22-10-31 18:50:49 DEBUG (MainThread) [supervisor.api.middleware.security] /ingress/validate_session access from Home Assistant
22-10-31 18:50:55 DEBUG (MainThread) [supervisor.api.middleware.security] Passthrough /supervisor/ping
22-10-31 18:50:55 DEBUG (MainThread) [supervisor.api.middleware.security] /supervisor/info access from Observer
22-10-31 18:50:55 DEBUG (MainThread) [supervisor.api.middleware.security] /resolution/info access from Observer
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /host/info access from Home Assistant
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /supervisor/info access from Home Assistant
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /info access from Home Assistant
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /core/info access from Home Assistant
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /network/info access from Home Assistant
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /resolution/info access from Home Assistant
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /os/info access from Home Assistant
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /addons access from Home Assistant
22-10-31 18:50:58 DEBUG (MainThread) [supervisor.api.middleware.security] /store access from Home Assistant
22-10-31 18:51:05 DEBUG (MainThread) [supervisor.api.middleware.security] /store/addons/f9ca086a_discord_bot_no_config access from Home Assistant
22-10-31 18:51:06 DEBUG (MainThread) [supervisor.api.middleware.security] /addons/f9ca086a_discord_bot_no_config/install access from Home Assistant
22-10-31 18:51:06 DEBUG (MainThread) [supervisor.utils.dbus] D-Bus call - org.freedesktop.NetworkManager.get_connectivity on /org/freedesktop/NetworkManager


22-10-31 18:51:06 ERROR (SyncWorker_1) [supervisor.docker.addon] Invalid build environment, can't build this add-on!


22-10-31 18:51:08 DEBUG (MainThread) [supervisor.api.middleware.security] /app/entrypoint.js access from Home Assistant
22-10-31 18:51:10 DEBUG (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from Home Assistant

That didn’t help.

Can you share this?

At the very least, you don’t specify from what base image you want to build your addon. That would be in a “build.yaml”. See Add-On Configuration | Home Assistant Developer Docs (home-assistant.io)

Also, no sure why you name your docker file with all uppercase, nor if it matters, but the convention is “Dockerfile”.

It’s true. Assuming we got past this I was going to suggest they switch to the python base image from here rather then adding python to the normal base image themselves.

That being said, build.yaml is entirely optional. If not specified then build_from defaults to this image (the alpine base image without python added). The only requirement is these options must be in config.yaml and the author has that. Hence why I’m a bit confused and hoping system info brings some insight.

Then maybe plainly the Dockerfile naming? Linux is case-dependent…

Sorry here is my system info :

Version	core-2022.10.5
Type d'installation	Home Assistant OS
Développement	false
Supervisor	true
Docker	true
Utilisateur	root
Environnement virtuel	false
Version de Python	3.10.5
Famille du système d'exploitation	Linux
Version du système d'exploitation	5.15.61-v8
Architecture du processeur	aarch64
Fuseau horaire	Europe/Paris
Répertoire de configuration	/config
Home Assistant Community Store
GitHub API	ok
GitHub Content	ok
GitHub Web	ok
GitHub API Calls Remaining	4887
Installed Version	1.28.2
Stage	running
Available Repositories	1210
Downloaded Repositories	15
Home Assistant Cloud
Connecté	false
Accéder au serveur de certificats	ok
Accéder au serveur d'authentification	ok
Accéder à Home Assistant Cloud	ok
Home Assistant Supervisor
Système d'exploitation hôte	Home Assistant OS 9.3
Mise à jour	beta
Version du Supervisor	supervisor-2022.10.2
Version de l'agent	1.4.1
Version de Docker	20.10.18
Taille total du disque	229.2 GB
Taille du disque utilisé	131.4 GB
Sain	true
Prise en charge	Unsupported
Tableau de bord	rpi4-64
API du Supervisor	ok
Version API	ok

I try locally to make a build.yaml or build.json but seems change nothing :confused:
Did I forgot something in config.yaml ? Like url description ?

Like CentralCommand (Mike) say, build_from is not require in the config file, but maybe we can add it temporarily to test is it change something ?

I try to search in others addon if something based on my system can be adapted to the addon.

Did I do a mistake naming my Dockerfile “DOCKERFILE” and not “Dockerfile” ?

Koying is right, it needs to be Dockerfile. Here’s where the error message you’re seeing comes from in the code:

And here’s the is_valid function that causes it when it returns false:

Path is definitely case sensitive so it won’t find DOCKERFILE.

Ok thanks, I try now to rename DOCKERFILE to Dockerfile.

Edit :
Finally work, Thannnnnnks

Thanks he was able to install the addon, sorry for this little problem, and have a Happy Spooky Day :wink: