uwsgi-docs icon indicating copy to clipboard operation
uwsgi-docs copied to clipboard

Need info about the "unable to load configuration from..." message

Open bajhn opened this issue 9 years ago • 5 comments

Please add an explanation of the significance of the "unable to load configuration from..." startup message. I just burned most of a day on this problem and only figured it out after reading the uwsgi source code. In my case, I'm working on an inherited project that used uwsgi 0.9.9.1, and the developer called the config file project.wsgi. Trying to run uwsgi 2.0.12 with that config file gave me this message but no reason as to why the configuration file could not be loaded. It turns out that uwsgi uses the filename extension to try to deduce what kind of file it is if the file type switch (e.g. --ini, --xml, etc.) is not specified, and my file name didn't fit any of the known types. Searching for the message only turned up other people as perplexed as I was, with no solution.

I would like to suggest a note in section https://uwsgi-docs.readthedocs.org/en/latest/Configuration.html#loading-configuration-files that reads something like this:

If the configuration file type is not specified in the parameter list (e.g. --ini, --xml, etc.), uwsgi tries to deduce the file type from the filename extension. If the extension is not a supported file type, uwsgi displays the message "unable to load configuration from..." and exits.

bajhn avatar Feb 25 '16 19:02 bajhn

AFAIK the default format if you don't specify it is ini. If you have any suggestion feel free to open a pull request. Thanks.

xrmx avatar Feb 25 '16 19:02 xrmx

@bajhn Just wanted to let you know that you probably saved me a ton of time. I'm using 2.0.17 and was for some reason trying to pass a config file (in ini format) like this:

-c myfile.conf

And I was getting the same unhelpful error. Using --ini or myfile.ini helped make it work. I would not have thought to try that without your comment.

jong avatar Nov 08 '18 20:11 jong

Yep, specifying --ini saved the day, thanks all!

vbhayden avatar Dec 30 '21 20:12 vbhayden

Thanks, you save my day

Firkraag avatar Feb 18 '23 15:02 Firkraag

您的邮件我已收到,我将会尽快给您回复信息。

IamPecker avatar Feb 18 '23 15:02 IamPecker