ttzeng / chat-bot

Chat bot 聊天機器人
0 stars 0 forks source link

Cloud function deployment failure #3

Closed ttzeng closed 1 year ago

ttzeng commented 1 year ago

The deployment failed with the following error:

"Traceback (most recent call last):
  File "/layers/google.python.pip/pip/bin/functions-framework", line 8, in <module>
    sys.exit(_cli())
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/functions_framework/_cli.py", line 36, in _cli
    app = create_app(target, source, signature_type)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/functions_framework/__init__.py", line 353, in create_app
    spec.loader.exec_module(source_module)
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/workspace/main.py", line 13, in <module>
    s.LINE_CHANNEL_ACCESS_TOKEN = sf.LINE_CHANNEL_ACCESS_TOKEN
AttributeError: module 'secrets' has no attribute 'LINE_CHANNEL_ACCESS_TOKEN'"
ttzeng commented 1 year ago

A good article on roading secrets in Python: How to Handle Secrets in Python