Projet

Général

Profil

Development #36635

logged_error: ne fonctione pas sur les fiches

Ajouté par Benjamin Dauvergne il y a plus de 4 ans. Mis à jour il y a environ 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
02 octobre 2019
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Il y a une référence explicite à FormDef.get_by_url_name qui foire avec un carddef (prace que ça ne tape pas sur le bon index carddef-url-name.

wcs/logged_errors.py:119:        formdef = FormDef.get_by_urlname(formdef_urlname)

Vu sur cette trace, en fait une 405 d'un wscall à l'origine :

## Validation Publik ##

Exception:
  type = '<type 'exceptions.KeyError'>', value = ''

Stack trace (most recent call first):
  File "/usr/lib/python2.7/dist-packages/wcs/qommon/storage.py", line 395, in get_filename
   393             if ignore_errors:
   394                 return None
>  395             raise KeyError()
   396         except ImportError as e:
   397             if ignore_errors:

  locals:
     cls = <class 'wcs.formdef.FormDef'>
     filename = '/var/lib/wcs/demarches-validation.test.entrouvert.org/formdefs-url_name/parent'
     ignore_errors = False
     ignore_migration = False
     kwargs = {}

  File "/usr/lib/python2.7/dist-packages/wcs/qommon/storage.py", line 352, in get_on_index
   350         filename = os.path.join(index_dir, str(fix_key(id)))
   351         return cls.get_filename(filename, ignore_errors=ignore_errors,
>  352                 ignore_migration=ignore_migration)
   353
   354     @classmethod

  locals:
     cls = <class 'wcs.formdef.FormDef'>
     filename = '/var/lib/wcs/demarches-validation.test.entrouvert.org/formdefs-url_name/parent'
     id = 'parent'
     ignore_errors = False
     ignore_migration = False
     index = 'url_name'
     index_dir = '/var/lib/wcs/demarches-validation.test.entrouvert.org/formdefs-url_name'
     objects_dir = '/var/lib/wcs/demarches-validation.test.entrouvert.org/formdefs'

  File "/usr/lib/python2.7/dist-packages/wcs/formdef.py", line 510, in get_by_urlname
   508     @classmethod
   509     def get_by_urlname(cls, url_name, ignore_migration=False):
>  510         return cls.get_on_index(url_name, 'url_name', ignore_migration=ignore_migration)
   511
   512     def get_url(self, backoffice=False, preview=False):

  locals:
     cls = <class 'wcs.formdef.FormDef'>
     ignore_migration = False
     url_name = 'parent'

  File "/usr/lib/python2.7/dist-packages/wcs/logged_errors.py", line 119, in record_exception
   117             # still be sent by email to administrators.
   118             return
>  119         formdef = FormDef.get_by_urlname(formdef_urlname)
   120         formdata = formdef.data_class().get(formdata_id, ignore_errors=True)
   121         cls.record(error_summary, plain_error_msg, formdata=formdata,

  locals:
     cls = <class 'wcs.logged_errors.LoggedError'>
     context = {'form_var_compte_user_var_last_name': 'Ecuvillon', 'session_user_field_adresse_electronique': 'mates@entrouvert.org', 'form_var_compte_user_f_address': None, 'hobo_url': 'https://hobo-validation.test.entrouvert.org/', 'session_user_field_nom': 'Ates', 'form_var_compte': 'Ana\xc3\xafs Ecuvillon', 'statistics_url': 'https://statistiques-validation.test.entrouvert.org/', 'form_var_compte_user_display_name': 'Ana\xc3\xafs Ecuvillon', 'session_user_f_address': '', 'form_objects': <wcs.variables.LazyFormDefObjectsManager object at 0x7fe5ee83d8d0>, 'form_status_url': 'https://demarches-validation.test.entrouvert.org/backoffice/data/parent/2/status', 'form_var_nom': 'Cros', 'form_status': 'Enregistr\xc3\xa9e', 'form_submission_channel': None, 'form_var_prenom': 'Pierre', 'session_user_field_date': '', 'form_var_compte_user_name_identifier_0': '208c00cf51f447be950e6c41df39745e', 'form_details': 'nom\xc2\xa0:\n  Cros\n\nPr\xc3\xa9rnom\xc2\xa0:\n  Pierre\n\nCompte\xc2\xa0:\n  Ana\xc3\xafs Ecuvillon\n\nAdresse\xc2\xa0:\n  Rue de la faim\n', 'cnil_compliant_visits_tracking_js': '// Matomo\nvar _paq = window._paq || [];\n// disallow cookie\'s time extension\n_paq.push([function() {\nvar self = this;\nfunction getOriginalVisitorCookieTimeout() {\nvar now = new Date(),\nnowTs = Math.round(now.getTime() / 1000),\nvisitorInfo = self.getVisitorInfo();\nvar createTs = parseInt(visitorInfo[2]);\nvar cookieTimeout = 33696000; // 13 months in seconds\nvar originalTimeout = createTs + cookieTimeout - nowTs;\nreturn originalTimeout;\n}\nthis.setVisitorCookieTimeout( getOriginalVisitorCookieTimeout() );\n}]);\n/* tracker methods like "setCustomDimension" should be called before "trackPageView" */\n_paq.push([\'trackPageView\']);\n_paq.push([\'enableLinkTracking\']);\n(function() {\nvar u="//matomo-test.entrouvert.org/";\n_paq.push([\'setTrackerUrl\', u+\'matomo.php\']);\n_paq.push([\'setSiteId\', \'2\']);\nvar d=document, g=d.createElement(\'script\'), s=d.getElementsByTagName(\'script\')[0];\ng.type=\'text/javascript\'; g.async=true; g.defer=true; g.src=u+\'matomo.js\'; s.parentNode.insertBefore(g,s);\n})();\n// End Matomo Code', 'form_receipt_date': '02/10/2019', 'session_user_field_prenom': 'Mikael', 'form_var_compte_user_field_civilite': None, 'form_var_compte_user_id': 20, 'no_extra_js': 'False', 'matomo_logme_url': 'https://matomo-test.entrouvert.org/index.php?module=Login&action=logme&login=validation.test.entrouvert.org&password=86d1a35cc80761eb0dac1428b0e32f62', 'site_url': 'https://demarches-validation.test.entrouvert.org', 'form_f1': 'Cros', 'theme': 'grosboule-les-bains', 'session_user_f_mobile': '', 'form_f4': 'Rue de la faim', 'form_number': '5-2', 'form_role_editor_name': 'Administrateur fonctionnel', 'session_var_compte': '616503fdbf824796adcf81cd63fcb0f6', 'form_var_compte_user_f_photo': None, 'session_user_var_photo': None, 'agendas_url': 'https://agendas-validation.test.entrouvert.org/', 'session_user_var_email': 'mates@entrouvert.org', 'session_user_display_name': 'Mikael Ates', 'environment_label': 'Validation', 'form_var_compte_user_admin_access': False, 'session_user_f_city': '', 'form_var_compte_user_field_photo': None, 'form_var_compte_user_var_city': None, 'form_var_adresse': 'Rue de la faim', 'form_receipt_time': '17:03', 'form_var_compte_user_field_mobile': None, 'form_role_editor_details': '', 'now': <LazyDateObject: <built-in method now of type object at 0x7fe600ef4aa0>>, 'form_field_nom': 'Cros', 'announces_url': 'https://annonces-validation.test.entrouvert.org/', 'theme_color': '#13b29c', 'manager_homepage_title': 'Portail Agent', 'data_source': <wcs.data_sources.DataSourcesSubstitutionProxy object at 0x7fe5ee8c7c50>, 'form_var_compte_user_var_title': None, 'session_user_admin_access': True, 'site_lang': 'fr', 'form_var_compte_user_f_numero_national': None, 'form_status_is_endpoint': False, 'session_user_var_mobile': '', 'form_var_compte_user_f_title': None, 'is_in_backoffice': True, 'site_theme': 'publik-base', 'form_url_backoffice': 'https://demarches-validation.test.entrouvert.org/backoffice/data/parent/2/', 'form_uri': 'parent/2/', 'session_user_var_phone': '', 'form_url': 'https://demarches-validation.test.entrouvert.org/backoffice/data/parent/2/', 'session_user_var_title': '', 'form_digest': 'Cros', 'attachments': <wcs.workflows.AttachmentsSubstitutionProxy object at 0x7fe5eee56610>, 'global_title': 'Validation Publik', 'session_user_f_photo': None, 'form_role_viewer_name': 'Administrateur fonctionnel', 'form_comment': '', 'passerelle_url': 'https://passerelle-validation.test.entrouvert.org/', 'form_var_compte_user_var_email': 'a.ecuvillon@ville-arles.fr', 'form_criticality_level': 0, 'form_var_compte_user_var_address': None, 'form_var_compte_user_f_city': None, 'form_var_compte_user_f_first_name': 'Ana\xc3\xafs', 'form_var_compte_user_var_zipcode': None, 'form_previous_status': '', 'form_receipt_datetime': datetime.datetime(2019, 10, 2, 17, 3, 15), 'session_user_var_numero_national': '', 'session_user_var_date': '', 'form_submission_context_agent_id': 8, 'form_var_compte_user_var_photo': None, 'form_var_compte_raw': '20', 'form_submission_channel_label': 'Web', 'session_user_f_zipcode': '', 'form_var_compte_user_field_numero_national': None, 'form_var_compte_user_var_date': '', 'idp_url': 'https://connexion-validation.test.entrouvert.org/', 'session_user_f_date': '', 'css_variant': 'grosboule-les-bains', 'form_var_compte_user_var_numero_national': None, 'eservices_url': 'https://demarches-validation.test.entrouvert.org/', 'form_role_viewer_emails': '', 'form_name': 'Parent', 'form_role_editor_emails': '', 'session_user_field_telephone': '', 'session_user_backoffice_access': True, 'session_user_var_zipcode': '', 'idp_account_url': 'https://connexion-validation.test.entrouvert.org/accounts/', 'session_user': <SqlUser 'Mikael Ates' id:8>, 'form_var_compte_user_f_last_name': 'Ecuvillon', 'idp_api_url': 'https://connexion-validation.test.entrouvert.org/api/', 'form_var_compte_user_var_first_name': 'Ana\xc3\xafs', 'form_number_raw': '2', 'session_user_field_civilite': '', 'form_field_adresse': 'Rue de la faim', 'form_var_compte_user_var_phone': None, 'session_user_f_email': 'mates@entrouvert.org', 'form_status_changed': True, 'script': <wcs.scripts.ScriptsSubstitutionProxy object at 0x7fe5eee56850>, 'form_role_viewer_details': '', 'session_user_f_last_name': 'Ates', 'form_f2': 'Pierre', 'portal_url': 'https://validation.test.entrouvert.org/', 'form_var_compte_user_field_commune': None, 'form_f3': '20', 'session_user_field_photo': None, 'today': <LazyDateObject: <built-in method today of type object at 0x7fe600ef4900>>, 'session_user_email': 'mates@entrouvert.org', 'form_var_compte_user_var_mobile': None, 'form_slug': 'parent', 'form': <wcs.variables.LazyFormData object at 0x7fe5eee564d0>, 'manager_homepage_url': 'https://agents-validation.test.entrouvert.org/', 'form_var_compte_user_field_nom': 'Ecuvillon', 'session_user_var_last_name': 'Ates', 'form_evolution': '\n\n----\n\nStatut\n  Enregistr\xc3\xa9e', 'session_user_f_phone': '', 'session_user_f_first_name': 'Mikael', 'session_user_field_commune': '', 'webservice': <wcs.wscalls.WsCallsSubstitutionProxy object at 0x7fe5eee56a90>, 'form_var_compte_user_f_zipcode': None, 'idp_registration_url': 'https://connexion-validation.test.entrouvert.org/accounts/register/', 'form_var_compte_user_field_telephone': None, 'session_user_var_first_name': 'Mikael', 'portal_user_title': 'Portail de validation', 'default_from_email': 'admin@entrouvert.com', 'form_var_compte_user_field_adresse': None, 'form_var_compte_user_field_prenom': 'Ana\xc3\xafs', 'session_user_var_address': '', 'site_name': 'D\xc3\xa9marches', 'session_user_name_identifier_0': '19a78aee2c264d7d999c040b4862ba2d', 'links': <function print_links at 0x7fe5ee788668>, 'form_display_name': 'Parent - n\xc2\xb05-2', 'session_user_field_numero_national': '', 'form_var_compte_user_field_code_postal': None, 'session_user_var_city': '', 'portal_agent_title': 'Portail Agent', 'form_var_compte_user_field_date': '', 'session_user_f_numero_national': '', 'form_var_compte_user_f_phone': None, 'portal_agent_url': 'https://agents-validation.test.entrouvert.org/', 'form_field_prernom': 'Pierre', 'form_submission_backoffice': True, 'form_var_compte_user_roles': [], 'form_var_compte_user_field_adresse_electronique': 'a.ecuvillon@ville-arles.fr', 'form_field_compte': '20', 'session_user_field_adresse': '', 'porte_doc_url': 'https://portedoc-validation.test.entrouvert.org/', 'form_var_compte_user_f_email': 'a.ecuvillon@ville-arles.fr', 'session_user_field_code_postal': '', 'email_signature': '', 'form_var_compte_user_f_date': '', 'portal_user_url': 'https://validation.test.entrouvert.org/', 'request': <wcs.variables.LazyRequest object at 0x7fe5ee83da10>, 'session_id': '54afd8d9891f09fb', 'site_url_backoffice': 'https://demarches-validation.test.entrouvert.org/backoffice', 'form_var_compte_user_backoffice_access': False, 'form_var_compte_user_email': 'a.ecuvillon@ville-arles.fr', 'session_user_field_mobile': '', 'form_var_compte_user_f_mobile': None, 'session_user_f_title': '', 'accueil_url': 'https://accueil-validation.test.entrouvert.org/'}
     error_summary = '[WSCALL] Exception: 405 Method Not Allowed'
     formdata_id = '2'
     formdef_urlname = 'parent'
     plain_error_msg = 'Exception:\n  type = \'<type \'exceptions.Exception\'>\', value = \'405 Method Not Allowed\'\n\nStack trace (most recent call first):\n  File "/usr/lib/python2.7/dist-packages/wcs/wf/wscall.py", line 411, in action_on_error\n   409 \n   410             if self.notify_on_errors:\n>  411                 get_publisher().notify_of_exception(exc_info, context=\'[WSCALL]\')\n   412             if self.record_errors and formdata.evolution:\n   413                 formdata.evolution[-1].add_part(\n\n  locals: \n     action = \':stop\'\n     data = \'{"errors":"M\\xc3\\xa9thode \\\\"POST\\\\" non autoris\\xc3\\xa9e.","result":0}\'\n     e = Exception(\'405 Method Not Allowed\',)\n     exc_info = (<type \'exceptions.Exception\'>, Exception(\'405 Method Not Allowed\',), <traceback object at 0x7fe5ee7a9b90>)\n     formdata = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     response = <Response [405]>\n     self = <WebserviceCallStatusItem 1>\n     summary = \'405 Method Not Allowed\'\n\n  File "/usr/lib/python2.7/dist-packages/wcs/wf/wscall.py", line 354, in perform\n   352             self.action_on_error(self.action_on_app_error, formdata, response, data=data)\n   353         if (status // 100) == 4:\n>  354             self.action_on_error(self.action_on_4xx, formdata, response, data=data)\n   355         if (status // 100) == 5:\n   356             self.action_on_error(self.action_on_5xx, formdata, response, data=data)\n\n  locals: \n     app_error_code = 0\n     app_error_code_header = None\n     d = {\'errors\': \'M\\xc3\\xa9thode "POST" non autoris\\xc3\\xa9e.\', \'result\': 0}\n     data = \'{"errors":"M\\xc3\\xa9thode \\\\"POST\\\\" non autoris\\xc3\\xa9e.","result":0}\'\n     formdata = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     response = <Response [405]>\n     self = <WebserviceCallStatusItem 1>\n     status = 405\n     workflow_data = {}\n\n  File "/usr/lib/python2.7/dist-packages/wcs/workflows.py", line 67, in perform_items\n    65             continue\n    66         try:\n>   67             url = item.perform(formdata) or url\n    68         except AbortActionException:\n    69             break\n\n  locals: \n     depth = 20\n     formdata = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     item = <WebserviceCallStatusItem 1>\n     items = [<EditableWorkflowStatusItem _editable>, <ChoiceWorkflowStatusItem _action_delete>, <ChoiceWorkflowStatusItem 0>, <WebserviceCallStatusItem 1>]\n     old_status = \'wf-recorded\'\n     url = None\n\n  File "/usr/lib/python2.7/dist-packages/wcs/formdata.py", line 480, in perform_workflow\n   478         wf_status = self.get_status()\n   479         from wcs.workflows import perform_items\n>  480         url = perform_items(wf_status.items, self)\n   481         return url\n   482 \n\n  locals: \n     perform_items = <function perform_items at 0x7fe5fa53b320>\n     self = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     url = None\n     wf_status = <WorkflowStatus recorded \'Enregistr\\xc3\\xa9e\'>\n\n  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/submission.py", line 222, in submitted\n   220         self.clean_submission_context()\n   221 \n>  222         url = filled.perform_workflow()\n   223         if url:\n   224             pass # always redirect to an URL the workflow returned\n\n  locals: \n     args = (None,)\n     filled = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     form = <wcs.qommon.form.Form object at 0x7fe5ee906a50>\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n\n  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/data_management.py", line 121, in submitted\n   119 \n   120     def submitted(self, form, *args):\n>  121         super(CardFillPage, self).submitted(form, *args)\n   122         if get_response().get_header(\'location\').endswith(\'/backoffice/submission/\'):\n   123             return redirect(\'..\')\n\n  locals: \n     args = (None,)\n     form = <wcs.qommon.form.Form object at 0x7fe5ee906a50>\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n\n  File "/usr/lib/python2.7/dist-packages/wcs/forms/root.py", line 935, in _q_index\n   933                 return template.error_page(_(\'This form has already been submitted.\'))\n   934 \n>  935             return self.submitted(form, existing_formdata)\n   936 \n   937 \n\n  locals: \n     authentication_context_check_result = None\n     data = {}\n     draft_id = None\n     existing_formdata = None\n     field = <StringField 4 \'Adresse\'>\n     filled = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     form = <wcs.qommon.form.Form object at 0x7fe5ee906a50>\n     form_data = {\'1\': \'Cros\', \'3_display\': \'Ana\\xc3\\xafs Ecuvillon\', \'3\': \'20\', \'2\': \'Pierre\', \'4\': \'Rue de la faim\', \'3_structured\': {\'user_var_address\': None, \'user_var_phone\': None, \'user_display_name\': \'Ana\\xc3\\xafs Ecuvillon\', \'user_var_title\': None, \'user_f_city\': None, \'user_field_nom\': \'Ecuvillon\', \'user_f_address\': None, \'user_var_city\': None, \'user_f_phone\': None, \'user_var_date\': \'\', \'user_field_commune\': None, \'user_field_date\': \'\', \'id\': 20, \'user_f_date\': \'\', \'user_f_first_name\': \'Ana\\xc3\\xafs\', \'user_f_mobile\': None, \'user_admin_access\': False, \'user_id\': 20, \'user_field_adresse\': None, \'user_f_numero_national\': None, \'user_f_last_name\': \'Ecuvillon\', \'user_field_adresse_electronique\': \'a.ecuvillon@ville-arles.fr\', \'user_f_zipcode\': None, \'user_roles\': [], \'text\': \'Ana\\xc3\\xafs Ecuvillon\', \'user_var_last_name\': \'Ecuvillon\', \'user_f_email\': \'a.ecuvillon@ville-arles.fr\', \'user_name_identifier_0\': \'208c00cf51f447be950e6c41df39745e\', \'user_f_photo\': None, \'user_var_zipcode\': None, \'user_var_first_name\': \'Ana\\xc3\\xafs\', \'user_field_telephone\': None, \'user_var_photo\': None, \'user_field_photo\': None, \'user_field_code_postal\': None, \'user_f_title\': None, \'user_backoffice_access\': False, \'user_var_email\': \'a.ecuvillon@ville-arles.fr\', \'user_field_civilite\': None, \'user_field_prenom\': \'Ana\\xc3\\xafs\', \'user_field_numero_national\': None, \'user_var_numero_national\': None, \'user_field_mobile\': None, \'user_email\': \'a.ecuvillon@ville-arles.fr\', \'user_var_mobile\': None}, \'draft_formdata_id\': 2}\n     k = \'4\'\n     magictoken = \'5592f66fa06673de\'\n     no_magic = <object object at 0x7fe5efad49f0>\n     page = None\n     page_error_messages = []\n     page_no = 1\n     prefill_user = None\n     req = <wcs.compat.CompatHTTPRequest instance at 0x7fe5ef741128>\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n     session = <Session at 7fe5ee7dcfd0: 54afd8d9891f09fb>\n     session_magic_token = <object object at 0x7fe5efad49f0>\n     step = 2\n     submitted_fields = [<StringField 1 \'nom\'>, <StringField 2 \'Pr\\xc3\\xa9rnom\'>, <ItemField 3 \'Compte\'>, <StringField 4 \'Adresse\'>]\n     transient_formdata = <FormData \'Parent - n\\xc2\\xb0None\' id:None>\n     v = \'Rue de la faim\'\n\n  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/submission.py", line 114, in _q_index\n   112 \n   113         self.selected_submission_channel = get_request().form.get(\'submission_channel\') or \'\'\n>  114         return super(FormFillPage, self)._q_index(*args, **kwargs)\n   115 \n   116     def html_top(self, *args, **kwargs):\n\n  locals: \n     args = ()\n     kwargs = {}\n     name_id = None\n     return_url = None\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n     submission_channel = None\n\n  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 67, in _q_traverse\n    65                 raise TraversalError\n    66         elif hasattr(obj, \'__call__\'):\n>   67             return obj()\n    68         else:\n    69             return obj\n\n  locals: \n     component = \'\'\n     name = \'_q_index\'\n     obj = <bound method CardFillPage._q_index of <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>>\n     path = []\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n\n  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse\n    61         if path:\n    62             if hasattr(obj, \'_q_traverse\'):\n>   63                 return obj._q_traverse(path)\n    64             else:\n    65                 raise TraversalError\n\n  locals: \n     component = \'add\'\n     name = \'add\'\n     obj = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n     path = [\'\']\n     self = <wcs.backoffice.data_management.CardPage object at 0x7fe5ee7ceb50>\n\n  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse\n    61         if path:\n    62             if hasattr(obj, \'_q_traverse\'):\n>   63                 return obj._q_traverse(path)\n    64             else:\n    65                 raise TraversalError\n\n  locals: \n     component = \'parent\'\n     name = None\n     obj = <wcs.backoffice.data_management.CardPage object at 0x7fe5ee7ceb50>\n     path = [\'add\', \'\']\n     self = <wcs.backoffice.data_management.DataManagementDirectory object at 0x7fe5f9b76cd0>\n\n  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/data_management.py", line 33, in _q_traverse\n    31     def _q_traverse(self, path):\n    32         get_response().breadcrumb.append((\'data/\', _(\'Cards Data\')))\n>   33         return super(ManagementDirectory, self)._q_traverse(path)\n    34 \n    35     def is_accessible(self, user):\n\n  locals: \n     path = [\'parent\', \'add\', \'\']\n     self = <wcs.backoffice.data_management.DataManagementDirectory object at 0x7fe5f9b76cd0>\n\n  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse\n    61         if path:\n    62             if hasattr(obj, \'_q_traverse\'):\n>   63                 return obj._q_traverse(path)\n    6 [...]
     publisher = <wcs.compat.CompatWcsPublisher object at 0x7fe5f6bf56d0>

  File "/usr/lib/python2.7/dist-packages/wcs/publisher.py", line 321, in log_internal_error
   319                 plain_error_msg, record=record)
   320         if record:
>  321             LoggedError.record_exception(error_summary, plain_error_msg, publisher=self)
   322
   323     def apply_global_action_timeouts(self):

  locals:
     error_summary = '[WSCALL] Exception: 405 Method Not Allowed'
     plain_error_msg = 'Exception:\n  type = \'<type \'exceptions.Exception\'>\', value = \'405 Method Not Allowed\'\n\nStack trace (most recent call first):\n  File "/usr/lib/python2.7/dist-packages/wcs/wf/wscall.py", line 411, in action_on_error\n   409 \n   410             if self.notify_on_errors:\n>  411                 get_publisher().notify_of_exception(exc_info, context=\'[WSCALL]\')\n   412             if self.record_errors and formdata.evolution:\n   413                 formdata.evolution[-1].add_part(\n\n  locals: \n     action = \':stop\'\n     data = \'{"errors":"M\\xc3\\xa9thode \\\\"POST\\\\" non autoris\\xc3\\xa9e.","result":0}\'\n     e = Exception(\'405 Method Not Allowed\',)\n     exc_info = (<type \'exceptions.Exception\'>, Exception(\'405 Method Not Allowed\',), <traceback object at 0x7fe5ee7a9b90>)\n     formdata = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     response = <Response [405]>\n     self = <WebserviceCallStatusItem 1>\n     summary = \'405 Method Not Allowed\'\n\n  File "/usr/lib/python2.7/dist-packages/wcs/wf/wscall.py", line 354, in perform\n   352             self.action_on_error(self.action_on_app_error, formdata, response, data=data)\n   353         if (status // 100) == 4:\n>  354             self.action_on_error(self.action_on_4xx, formdata, response, data=data)\n   355         if (status // 100) == 5:\n   356             self.action_on_error(self.action_on_5xx, formdata, response, data=data)\n\n  locals: \n     app_error_code = 0\n     app_error_code_header = None\n     d = {\'errors\': \'M\\xc3\\xa9thode "POST" non autoris\\xc3\\xa9e.\', \'result\': 0}\n     data = \'{"errors":"M\\xc3\\xa9thode \\\\"POST\\\\" non autoris\\xc3\\xa9e.","result":0}\'\n     formdata = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     response = <Response [405]>\n     self = <WebserviceCallStatusItem 1>\n     status = 405\n     workflow_data = {}\n\n  File "/usr/lib/python2.7/dist-packages/wcs/workflows.py", line 67, in perform_items\n    65             continue\n    66         try:\n>   67             url = item.perform(formdata) or url\n    68         except AbortActionException:\n    69             break\n\n  locals: \n     depth = 20\n     formdata = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     item = <WebserviceCallStatusItem 1>\n     items = [<EditableWorkflowStatusItem _editable>, <ChoiceWorkflowStatusItem _action_delete>, <ChoiceWorkflowStatusItem 0>, <WebserviceCallStatusItem 1>]\n     old_status = \'wf-recorded\'\n     url = None\n\n  File "/usr/lib/python2.7/dist-packages/wcs/formdata.py", line 480, in perform_workflow\n   478         wf_status = self.get_status()\n   479         from wcs.workflows import perform_items\n>  480         url = perform_items(wf_status.items, self)\n   481         return url\n   482 \n\n  locals: \n     perform_items = <function perform_items at 0x7fe5fa53b320>\n     self = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     url = None\n     wf_status = <WorkflowStatus recorded \'Enregistr\\xc3\\xa9e\'>\n\n  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/submission.py", line 222, in submitted\n   220         self.clean_submission_context()\n   221 \n>  222         url = filled.perform_workflow()\n   223         if url:\n   224             pass # always redirect to an URL the workflow returned\n\n  locals: \n     args = (None,)\n     filled = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     form = <wcs.qommon.form.Form object at 0x7fe5ee906a50>\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n\n  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/data_management.py", line 121, in submitted\n   119 \n   120     def submitted(self, form, *args):\n>  121         super(CardFillPage, self).submitted(form, *args)\n   122         if get_response().get_header(\'location\').endswith(\'/backoffice/submission/\'):\n   123             return redirect(\'..\')\n\n  locals: \n     args = (None,)\n     form = <wcs.qommon.form.Form object at 0x7fe5ee906a50>\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n\n  File "/usr/lib/python2.7/dist-packages/wcs/forms/root.py", line 935, in _q_index\n   933                 return template.error_page(_(\'This form has already been submitted.\'))\n   934 \n>  935             return self.submitted(form, existing_formdata)\n   936 \n   937 \n\n  locals: \n     authentication_context_check_result = None\n     data = {}\n     draft_id = None\n     existing_formdata = None\n     field = <StringField 4 \'Adresse\'>\n     filled = <Parent \'Parent - n\\xc2\\xb05-2\' id:2>\n     form = <wcs.qommon.form.Form object at 0x7fe5ee906a50>\n     form_data = {\'1\': \'Cros\', \'3_display\': \'Ana\\xc3\\xafs Ecuvillon\', \'3\': \'20\', \'2\': \'Pierre\', \'4\': \'Rue de la faim\', \'3_structured\': {\'user_var_address\': None, \'user_var_phone\': None, \'user_display_name\': \'Ana\\xc3\\xafs Ecuvillon\', \'user_var_title\': None, \'user_f_city\': None, \'user_field_nom\': \'Ecuvillon\', \'user_f_address\': None, \'user_var_city\': None, \'user_f_phone\': None, \'user_var_date\': \'\', \'user_field_commune\': None, \'user_field_date\': \'\', \'id\': 20, \'user_f_date\': \'\', \'user_f_first_name\': \'Ana\\xc3\\xafs\', \'user_f_mobile\': None, \'user_admin_access\': False, \'user_id\': 20, \'user_field_adresse\': None, \'user_f_numero_national\': None, \'user_f_last_name\': \'Ecuvillon\', \'user_field_adresse_electronique\': \'a.ecuvillon@ville-arles.fr\', \'user_f_zipcode\': None, \'user_roles\': [], \'text\': \'Ana\\xc3\\xafs Ecuvillon\', \'user_var_last_name\': \'Ecuvillon\', \'user_f_email\': \'a.ecuvillon@ville-arles.fr\', \'user_name_identifier_0\': \'208c00cf51f447be950e6c41df39745e\', \'user_f_photo\': None, \'user_var_zipcode\': None, \'user_var_first_name\': \'Ana\\xc3\\xafs\', \'user_field_telephone\': None, \'user_var_photo\': None, \'user_field_photo\': None, \'user_field_code_postal\': None, \'user_f_title\': None, \'user_backoffice_access\': False, \'user_var_email\': \'a.ecuvillon@ville-arles.fr\', \'user_field_civilite\': None, \'user_field_prenom\': \'Ana\\xc3\\xafs\', \'user_field_numero_national\': None, \'user_var_numero_national\': None, \'user_field_mobile\': None, \'user_email\': \'a.ecuvillon@ville-arles.fr\', \'user_var_mobile\': None}, \'draft_formdata_id\': 2}\n     k = \'4\'\n     magictoken = \'5592f66fa06673de\'\n     no_magic = <object object at 0x7fe5efad49f0>\n     page = None\n     page_error_messages = []\n     page_no = 1\n     prefill_user = None\n     req = <wcs.compat.CompatHTTPRequest instance at 0x7fe5ef741128>\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n     session = <Session at 7fe5ee7dcfd0: 54afd8d9891f09fb>\n     session_magic_token = <object object at 0x7fe5efad49f0>\n     step = 2\n     submitted_fields = [<StringField 1 \'nom\'>, <StringField 2 \'Pr\\xc3\\xa9rnom\'>, <ItemField 3 \'Compte\'>, <StringField 4 \'Adresse\'>]\n     transient_formdata = <FormData \'Parent - n\\xc2\\xb0None\' id:None>\n     v = \'Rue de la faim\'\n\n  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/submission.py", line 114, in _q_index\n   112 \n   113         self.selected_submission_channel = get_request().form.get(\'submission_channel\') or \'\'\n>  114         return super(FormFillPage, self)._q_index(*args, **kwargs)\n   115 \n   116     def html_top(self, *args, **kwargs):\n\n  locals: \n     args = ()\n     kwargs = {}\n     name_id = None\n     return_url = None\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n     submission_channel = None\n\n  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 67, in _q_traverse\n    65                 raise TraversalError\n    66         elif hasattr(obj, \'__call__\'):\n>   67             return obj()\n    68         else:\n    69             return obj\n\n  locals: \n     component = \'\'\n     name = \'_q_index\'\n     obj = <bound method CardFillPage._q_index of <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>>\n     path = []\n     self = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n\n  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse\n    61         if path:\n    62             if hasattr(obj, \'_q_traverse\'):\n>   63                 return obj._q_traverse(path)\n    64             else:\n    65                 raise TraversalError\n\n  locals: \n     component = \'add\'\n     name = \'add\'\n     obj = <wcs.backoffice.data_management.CardFillPage object at 0x7fe5ee724850>\n     path = [\'\']\n     self = <wcs.backoffice.data_management.CardPage object at 0x7fe5ee7ceb50>\n\n  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse\n    61         if path:\n    62             if hasattr(obj, \'_q_traverse\'):\n>   63                 return obj._q_traverse(path)\n    64             else:\n    65                 raise TraversalError\n\n  locals: \n     component = \'parent\'\n     name = None\n     obj = <wcs.backoffice.data_management.CardPage object at 0x7fe5ee7ceb50>\n     path = [\'add\', \'\']\n     self = <wcs.backoffice.data_management.DataManagementDirectory object at 0x7fe5f9b76cd0>\n\n  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/data_management.py", line 33, in _q_traverse\n    31     def _q_traverse(self, path):\n    32         get_response().breadcrumb.append((\'data/\', _(\'Cards Data\')))\n>   33         return super(ManagementDirectory, self)._q_traverse(path)\n    34 \n    35     def is_accessible(self, user):\n\n  locals: \n     path = [\'parent\', \'add\', \'\']\n     self = <wcs.backoffice.data_management.DataManagementDirectory object at 0x7fe5f9b76cd0>\n\n  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse\n    61         if path:\n    62             if hasattr(obj, \'_q_traverse\'):\n>   63                 return obj._q_traverse(path)\n    6 [...]
     record = True
     self = <wcs.compat.CompatWcsPublisher object at 0x7fe5f6bf56d0>

Fichiers

Révisions associées

Révision 08ce2ae8 (diff)
Ajouté par Frédéric Péters il y a environ 4 ans

misc: correctly attach cards to logged errors (#36635)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a plus de 4 ans

  • Description mis à jour (diff)
#2

Mis à jour par Frédéric Péters il y a environ 4 ans

Plutôt que l'ajout du form_class_name on aurait pu se dire que dans le context il y a désormais aussi le LazyFormData dans 'form' et exploiter ça, mais ça faisait moins clair, j'ai trouvé.

#3

Mis à jour par Benjamin Dauvergne il y a environ 4 ans

  • Statut changé de Solution proposée à Solution validée
#4

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 08ce2ae8512f2c81ac9fd9f51cfd5138cd52d888
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Tue Jan 28 16:51:01 2020 +0100

    misc: correctly attach cards to logged errors (#36635)
#5

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF