Check configuration error

I’m not really sure where to post this, but when I try to check my configuration using the webui it never completes. When I run check configuration from the command line on my Raspberry Pi I get the following error:

pi@haven:~ $ ./check_config
Testing configuration at /home/homeassistant/.homeassistant
ERROR:homeassistant.scripts.check_config:BURB
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/scripts/check_config.py", line 207, in check
    res['components'] = check_ha_config_file(hass)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/scripts/check_config.py", line 328, in check_ha_config_file
    del core_config[CONF_PACKAGES]
KeyError: 'packages'
Fatal error while loading config: 'packages'
Failed config
  General Errors: 
    - 'packages'

Successful config (partial)

My command looks like this:

sudo /srv/homeassistant/bin/hass --script check_config -c /home/homeassistant/.homeassistant

I believe you need to run as homeassistant, and you need to be in the virtual environment. Of course, this depends on which installation method you used I guess. I’d suggest trying this:

sudo -u homeassistant -H -s
cd ~/.homeassistant/
source /srv/homeassistant/bin/activate
hass --script check_config

Then, when you’re done:

deactivate
exit

This is caused by an error in your configuration either under a customize: or whitelist_external_dirs: key.

It depends on the environment from your installation. As pnbruckner Check configuration error wrote.
How about the proper python version ( pyhton -V in your hass environment)?
Python version required?

The only change I made was to add the changes here, to my configuration.yaml. @pnbruckner I still get the same error, when running as the homeassitant user. @honikos my python version is:

homeassistant@haven:~/.homeassistant $ python -V
Python 3.5.3

Did you activate the Python virtual environment for HASS?

Would have been nice to have here - information before. The new authentication API isn’t easy stuff.
Dr. google told me it could be something to do with whitelist_external_dirs:. As the API works with external dir give it a try.
As first step it’s easier to use the build-in auth provider?

It seems it was a problem with a customize/customize_glob entry, as after working on the problem for last two or three hours, I restored from a recent backup, and all is well.