Taapeli / stk-upload

Base for stk server with data upload and browsing
GNU General Public License v2.0
3 stars 1 forks source link

Sähköpostin lähetys Gramps-latauksen jälkeen ei toimi #13

Closed kkujansuu closed 5 years ago

kkujansuu commented 5 years ago

Näyttää siltä että aina Gramps-XML-tiedoston tietokantaan latauksen jälkeen tulee ao. virhe eikä vastaava sähköpostin lähetys onnistu. Koodi on funktiossa background_load_to_neo4j (app/bp/admin/uploads.py). Tämä kai toimi ennen kuin siirryttiin käyttämään sähköpostin lähetyksessä flask_mailia.

[Wed Mar 13 17:33:54.568844 2019] [wsgi:error] INFO Persons: 1949: 213.9166 [Wed Mar 13 17:33:54.568872 2019] [wsgi:error] INFO Families: 736: 59.0672 [Wed Mar 13 17:33:54.568900 2019] [wsgi:error] INFO Confidences set: 0: 0.0080 [Wed Mar 13 17:33:54.568932 2019] [wsgi:error] INFO Refname references: 6141: 26.9264 [Wed Mar 13 17:33:54.568958 2019] [wsgi:error] INFO Sorting names: 1949: [Wed Mar 13 17:33:54.568987 2019] [wsgi:error] INFO Estimated person lifetimes: 1721: 0.2529 [Wed Mar 13 17:33:54.569042 2019] [wsgi:error] TITLE Total time: : 749.4900 [Wed Mar 13 17:33:54.592853 2019] [wsgi:error] 2019-03-13 17:33:54,592 - root - ERROR - iError in sending email [Wed Mar 13 17:33:54.593012 2019] [wsgi:error] 2019-03-13 17:33:54,592 - root - ERROR - Working outside of application context. [Wed Mar 13 17:33:54.593036 2019] [wsgi:error] [Wed Mar 13 17:33:54.593065 2019] [wsgi:error] This typically means that you attempted to use functionality that needed [Wed Mar 13 17:33:54.593078 2019] [wsgi:error] to interface with the current application object in some way. To solve [Wed Mar 13 17:33:54.593090 2019] [wsgi:error] this, set up an application context with app.app_context(). See the [Wed Mar 13 17:33:54.593104 2019] [wsgi:error] documentation for more information. [Wed Mar 13 17:33:54.593121 2019] [wsgi:error] [Wed Mar 13 17:33:54.636511 2019] [wsgi:error] Traceback (most recent call last): [Wed Mar 13 17:33:54.636620 2019] [wsgi:error] File "/var/www/webroot/ROOT/app/models/email.py", line 17, in email mail.send(msg) [Wed Mar 13 17:33:54.636659 2019] [wsgi:error] File "/opt/jelastic-python37/lib/python3.7/site-packages/flask_mail.py", line 491, in send [Wed Mar 13 17:33:54.636673 2019] [wsgi:error] with self.connect() as connection: [Wed Mar 13 17:33:54.636691 2019] [wsgi:error] File "/opt/jelastic-python37/lib/python3.7/site-packages/flask_mail.py", line 508, in connect [Wed Mar 13 17:33:54.636705 2019] [wsgi:error] return Connection(app.extensions['mail']) [Wed Mar 13 17:33:54.636723 2019] [wsgi:error] File "/opt/jelastic-python37/lib/python3.7/site-packages/werkzeug/local.py", line 347, in getattr [Wed Mar 13 17:33:54.636737 2019] [wsgi:error] return getattr(self._get_current_object(), name) [Wed Mar 13 17:33:54.636754 2019] [wsgi:error] File "/opt/jelastic-python37/lib/python3.7/site-packages/werkzeug/local.py", line 306, in _get_current_object [Wed Mar 13 17:33:54.636768 2019] [wsgi:error] return self.__local() [Wed Mar 13 17:33:54.636785 2019] [wsgi:error] File "/opt/jelastic-python37/lib/python3.7/site-packages/flask/globals.py", line 51, in _find_app [Wed Mar 13 17:33:54.636799 2019] [wsgi:error] raise RuntimeError(_app_ctx_err_msg) [Wed Mar 13 17:33:54.636849 2019] [wsgi:error] RuntimeError: Working outside of application context. [Wed Mar 13 17:33:54.636866 2019] [wsgi:error] [Wed Mar 13 17:33:54.636878 2019] [wsgi:error] This typically means that you attempted to use functionality that needed [Wed Mar 13 17:33:54.636890 2019] [wsgi:error] to interface with the current application object in some way. To solve [Wed Mar 13 17:33:54.636903 2019] [wsgi:error] this, set up an application context with app.app_context(). See the [Wed Mar 13 17:33:54.636918 2019] [wsgi:error] documentation for more information.

kkujansuu commented 5 years ago

Korjattu sivulla https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-x-email-support olevan ohjeen mukaan.