Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'APP_NAME', formatter.add_service_name(self.application.config["APP_NAME"]) #242

Closed
NguyenDangBinh opened this issue Nov 19, 2022 · 1 comment · Fixed by #246
Closed

Comments

@NguyenDangBinh
Copy link

Describe the bug
from pyms.flask.app import Microservice
ms = Microservice()
app = ms.create_app()
if name == 'main':
app.run()

And I had this errors. Can I help me?
Traceback (most recent call last):
File "main.py", line 7, in
app = ms.create_app()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pyms\flask\app\create_app.py", line 164, in create_app
self.init_logger()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pyms\flask\app\create_app.py", line 104, in init_logger
formatter.add_service_name(self.application.config["APP_NAME"])
KeyError: 'APP_NAME'

@NguyenDangBinh
Copy link
Author

dear all,
I update the error below.
ms = Microservice()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pyms\flask\app\utils.py", line 16, in call
cls._instances[cls] = super(SingletonMeta, cls).call(*args, **kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pyms\flask\app\create_app.py", line 47, in init
validate_conf()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pyms\config\conf.py", line 44, in validate_conf
config = ConfFile(*args, **kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pyms\config\confile.py", line 60, in init
raise ConfigDoesNotFoundException("Configuration file {}not found".format(path + " "))
pyms.exceptions.ConfigDoesNotFoundException: Configuration file not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant