IsADirectoryError after Installing AppDaemon 3

I decided to upgrade to AppDaemon 3 (I uninstalled AppDaemon 2.1.12, then installed with sudo pip3 install --pre appdaemon).

I created a folder /home/pi/conf to store configuration files. Permissions are set to drwxr-xr-x

When trying to start AppDaemon using:

appdaemon -c /home/pi/conf

I get the following error:

IsADirectoryError: [Errno 21] Is a directory: ‘/home/pi/conf’

is the appdaemon.yaml in the directory ‘/home/pi/conf’?
or did you move your complete old config folder into it?
and are the permissions set for all files inside that dir?

Yes, appdaemon.yaml is in /home/pi/conf.

I moved only the following into this conf folder:
appdaemon.log
appdaemon.yaml
apps.yaml
secrets.yaml (eventually I want to point the the HA secrets file)

I set the permissions for the files and the directory to wide open. Still no joy.

  1. there needs to be a subdir apps
  2. apps.yaml needs to be inside the apps subdir

if that still not works, please post the complete log from the start and your appdaemon.yaml

(First, a big thanks for your help.)

I created an apps subdirectory, and I put apps.yaml in that subdirectory. Still getting the same error. This is the output to the terminal:

pi@pi-ha:~ $ appdaemon -c /home/pi/conf
Traceback (most recent call last):
File “/usr/local/bin/appdaemon”, line 11, in
sys.exit(main())
File “/usr/local/lib/python3.5/dist-packages/appdaemon/admain.py”, line 365, in main
admain.main()
File “/usr/local/lib/python3.5/dist-packages/appdaemon/admain.py”, line 279, in main
fh = RotatingFileHandler(logfile, maxBytes=log_size, backupCount=log_generations)
File “/usr/lib/python3.5/logging/handlers.py”, line 150, in init
BaseRotatingHandler.init(self, filename, mode, encoding, delay)
File “/usr/lib/python3.5/logging/handlers.py”, line 57, in init
logging.FileHandler.init(self, filename, mode, encoding, delay)
File “/usr/lib/python3.5/logging/init.py”, line 1009, in init
StreamHandler.init(self, self._open())
File “/usr/lib/python3.5/logging/init.py”, line 1038, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
IsADirectoryError: [Errno 21] Is a directory: ‘/home/pi/conf’

There is no output to the log file. The last entries to the log file are those from right before I upgraded AppDaemon.

Any idea what “IsADirectoryError” indicates? ‘/home/pi/conf’ is a directory (the error seems to suggest that it is not).

My appdaemon.yaml contains this:

log:
  errorfile: /home/pi/conf
  logfile: /home/pi/conf
  log_generations: 3
  log_size: 1000000
appdaemon:
  threads: 10
  api_port: 5000
  plugins:
    HASS:
      type: hass
      ha_url: !secret home_assistant_url
      ha_key: !secret http_password

did you reboot your device?

it seems that /home/pi/conf isnt right.
there are normally a few options

  1. the dir doesnt exist
  2. no rights
  3. no appdaemon.yaml
  4. no rights to appdaemon.yaml or apps.yaml

it could be that something is hanging in memory, thats why rebooting is neccesary after such changes.

I had rebooted and the permissions seem opened up to anyone — still no luck. I’m going to check folder permissions again and then uninstall/reinstall AppDaemon, and also create a folder in a different location.

I got it working :slight_smile: . Started with a backup SD card image I had prior to uninstalling AppDaemon 2.1.12. Then did the process again to install AD 3 beta.

  • Stopped AD and HA.
  • Uninstalled AD 2.1.12 (sudo pip3 uninstall appdaemon), and deleted config folders. Rebooted.
  • Installed AD 3 beta (sudo pip3 install --pre appdaemon). Rebooted.
  • Created an appdaemon config folder under my HA config folder (different location than last time). Put appdaemon.yaml in this folder.
  • Created apps folder under appdaemon config folder. Created hello.py and apps.yaml (for testing). Rebooted.
  • Started AD using appdaemon -c /home/pi/.homeassistant/appdaemon

All seems to be working!

My appdaemon.yaml:

secrets: /home/pi/.homeassistant/secrets.yaml
log:
  accessfile: /home/pi/.homeassistant/appdaemon/access.log
  errorfile: /home/pi/.homeassistant/appdaemon/error.log
  logfile: /home/pi/.homeassistant/appdaemon/appdaemon.log
  log_generations: 3
  log_size: 1000000
appdaemon:
  threads: 10
  #time_zone: <time zone>
  #api_port: 5000
  #api_key: !secret api_key
  #api_ssl_certificate: <path/to/root/CA/cert>
  #api_ssl_key: <path/to/root/CA/key>
  plugins:
    HASS:
      type: hass
      ha_url: !secret home_assistant_url
      ha_key: !secret http_password
      #cert_path: <path/to/root/CA/cert>
      #cert_verify: True
      namespace: default
1 Like