The settings you are looking for should be set in site.ini. Check the following:
- are the settings actually defined in the correct sections of the configuration file. - check if caches are actually created where you expect them to be (sounds like it since it only complains the first time)
I JUST had this problem myself, it was driving me and the sys admin crazy, we tried refreshing everything, changing the file, and then eventually deleting the file.
What was happening was no matter what I did, it still gave the error. Eventually I backed up that specific file and deleted it on the server, but it still had it cached somehow.
To solve the problem, we backstepped and deleted everything (all folders and files) under home/www/dev/var/plain/cache/ and on a next refresh, ezpublish was fine. MAKE SURE YOU BACK THOSE FILES UP FIRST!!!!