fedora-infra / fas

Fedora Account System
https://admin.fedoraproject.org/accounts
GNU General Public License v2.0
40 stars 50 forks source link

Editing profile info with empty bugzilla email field crashes #238

Closed ryanlerch closed 3 years ago

ryanlerch commented 7 years ago

If i try to edit (i.e. http://localhost:5002/people/profile/1587/edit) my user profile, and the bugzilla email field is empty, FAS crashes with the error at the bottom of this report.

Steps to reproduce:

  1. Log in to a FAS account that does not have a bugzilla email set, and edit the profile
  2. make sure that the IRC field has contents (workaround for issue #237 )
  3. edit a field other than the bugzilla email field
  4. click save changes
Traceback (most recent call last):                                                                                     
  File "/usr/lib/python2.7/site-packages/waitress/channel.py", line 338, in service                                    
    task.service()                                                                                                     
  File "/usr/lib/python2.7/site-packages/waitress/task.py", line 169, in service                                       
    self.execute()                                                                                                     
  File "/usr/lib/python2.7/site-packages/waitress/task.py", line 399, in execute                                       
    app_iter = self.channel.server.application(env, start_response)                                                    
  File "/usr/lib/python2.7/site-packages/pyramid/router.py", line 236, in __call__                                     
    response = self.invoke_subrequest(request, use_tweens=True)                                                        
  File "/usr/lib/python2.7/site-packages/pyramid/router.py", line 211, in invoke_subrequest                            
    response = handle_request(request)                                                                                 
  File "/usr/lib/python2.7/site-packages/pyramid_debugtoolbar/toolbar.py", line 187, in toolbar_tween                  
    return handler(request)                                                                                            
  File "/usr/lib/python2.7/site-packages/pyramid/tweens.py", line 62, in excview_tween                                 
    reraise(*attrs['exc_info'])                                                                                        
  File "/usr/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween                                 
    response = handler(request)                                                                                        
  File "/usr/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 119, in tm_tween                                
    reraise(*exc_info)                                                                                                 
  File "/usr/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 105, in tm_tween                                
    manager.commit()                                                                                                   
  File "/usr/lib/python2.7/site-packages/transaction/_manager.py", line 124, in commit                                 
    return self.get().commit()                                                                                         
  File "/usr/lib/python2.7/site-packages/transaction/_transaction.py", line 311, in commit                             
    reraise(t, v, tb)                                                                                                  
  File "/usr/lib/python2.7/site-packages/transaction/_transaction.py", line 302, in commit                             
    self._commitResources()                                                                                            
  File "/usr/lib/python2.7/site-packages/transaction/_transaction.py", line 447, in _commitResources                   
    reraise(t, v, tb)                                                                                                  
  File "/usr/lib/python2.7/site-packages/transaction/_transaction.py", line 419, in _commitResources                   
    rm.tpc_begin(self)                                                                                                 
  File "/usr/lib/python2.7/site-packages/zope/sqlalchemy/datamanager.py", line 96, in tpc_begin                        
    self.session.flush()                                                                                               
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 2137, in flush                             
    self._flush(objects)                                                                                               
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 2257, in _flush                            
    transaction.rollback(_capture_exception=True)                                                                      
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__                       
    compat.reraise(exc_type, exc_value, exc_tb)                                                                        
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 2221, in _flush                            
    flush_context.execute()                                                                                            
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 389, in execute                         
    rec.execute(self)                                                                                                  
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 548, in execute                         
    uow                                                                                                                
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 177, in save_obj                       
    mapper, table, update)                                                                                             
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 737, in _emit_update_statements        
    execute(statement, multiparams)                                                                                    
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute                            
    return meth(self, multiparams, params)                                                                             
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection            
    return connection._execute_clauseelement(self, multiparams, params)                                                
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement            
    compiled_sql, distilled_params                                                                                     
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context                  
    context)                                                                                                           
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1393, in _handle_dbapi_exception           
    exc_info                                                                                                           
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause                   
    reraise(type(exception), exception, tb=exc_tb, cause=cause)                                                        
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context                  
    context)                                                                                                           
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 469, in do_execute                      
    cursor.execute(statement, parameters)                                                                              
IntegrityError: (psycopg2.IntegrityError) duplicate key value violates unique constraint "people_bugzilla_email_key"   
DETAIL:  Key (bugzilla_email)=() already exists.                                                                       
ryanlerch commented 3 years ago

Closing this issue as the FAS project is now archived, not actively developed, and unmaintained.

FAS was replaced in March 2021 by Fedora Accounts (https://accounts.fedoraproject.org).

If this issue is a Feature Request that you forsee might be beneficial to Fedora Accounts, please refile it against Noggin