#10181 src.fpo.: Unable to orphan the package: An error occurred at the database level and prevent the action from reaching completion
Closed: Fixed 9 months ago by kevin. Opened a year ago by churchyard.

Describe what you would like us to do:

When I go to https://src.fedoraproject.org/rpms/python-cocotb and I try to orphan the package with the reason "Important bug not fixed" and additional info "https://bugzilla.redhat.com/1976454", I get:

Unable to orphan the package: An error occurred at the database level and prevent the action from reaching completion

When do you need this to be done by? (YYYY/MM/DD)

No deadline.


I think there's either an ongoing networking / DNS or database issue in fedora infra ... because I'm now unable to push anything to dist-git with the pre-receive hook failing to connect to either PDC or the database server. I'm getting either

could not connect to server: Connection timed out
remote:     Is the server running on host "db01.iad2.fedoraproject.org" (10.3.163.41) and accepting
remote:     TCP/IP connections on port 5432?

or

Failed to establish a new connection: [Errno -2] Name or service not known'

Everything should be back to working now, can you please retry?

Metadata Update from @kevin:
- Issue priority set to: Waiting on Assignee (was: Needs Review)
- Issue tagged with: low-gain, low-trouble, ops

a year ago

I still get:

Unable to orphan the package: An error occurred at the database level and prevent the action from reaching completion

Traceback:

[Thu Aug 26 21:03:07.420392 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] [2021-08-26 21:03:07,415] ERROR in plugin: Error when orphaning project                                             
[Thu Aug 26 21:03:07.420434 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] Traceback (most recent call last):                                                                                  
[Thu Aug 26 21:03:07.420438 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context               
[Thu Aug 26 21:03:07.420440 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor, statement, parameters, context                                                                          
[Thu Aug 26 21:03:07.420442 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute                   
[Thu Aug 26 21:03:07.420445 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor.execute(statement, parameters)                                                                           
[Thu Aug 26 21:03:07.420447 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] psycopg2.IntegrityError: duplicate key value violates unique constraint "ix_pagure_orphan_reason_pagure_orphan_reason
_project_id"                                                                                                                                                                                                                    
[Thu Aug 26 21:03:07.420449 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] DETAIL:  Key (project_id)=(38613) already exists.                                                                   
[Thu Aug 26 21:03:07.420450 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                                                                     
[Thu Aug 26 21:03:07.420452 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                                                                     
[Thu Aug 26 21:03:07.420454 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] The above exception was the direct cause of the following exception:                                                
[Thu Aug 26 21:03:07.420456 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                                                                     
[Thu Aug 26 21:03:07.420457 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] Traceback (most recent call last):                                                                                  
[Thu Aug 26 21:03:07.420459 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure_distgit/plugin.py", line 310, in orphan_endpoint                    
[Thu Aug 26 21:03:07.420461 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     flask.g.session, repo, user_obj.username, "-1"                                                                  
[Thu Aug 26 21:03:07.420463 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 4697, in update_watch_status                    
[Thu Aug 26 21:03:07.420464 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     user_obj = get_user(session, user)                                                                              
[Thu Aug 26 21:03:07.420466 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 126, in get_user                                
[Thu Aug 26 21:03:07.420468 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     user_obj = search_user(session, username=key)                                                                   
[Thu Aug 26 21:03:07.420470 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 215, in search_user                             
[Thu Aug 26 21:03:07.420472 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     output = query.first()                                                                                          
[Thu Aug 26 21:03:07.420474 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3215, in first                            
[Thu Aug 26 21:03:07.420476 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     ret = list(self[0:1])                                                                                           
[Thu Aug 26 21:03:07.420477 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3007, in __getitem__                      
[Thu Aug 26 21:03:07.420486 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return list(res)                                                                                                
[Thu Aug 26 21:03:07.420487 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3316, in __iter__                         
[Thu Aug 26 21:03:07.420489 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self.session._autoflush()                                                                                       
[Thu Aug 26 21:03:07.420491 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 1587, in _autoflush                     
[Thu Aug 26 21:03:07.420493 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     util.raise_from_cause(e)                                                                                        
[Thu Aug 26 21:03:07.420495 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause                
[Thu Aug 26 21:03:07.420497 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     reraise(type(exception), exception, tb=exc_tb, cause=cause)                                                     
[Thu Aug 26 21:03:07.420498 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise                         
[Thu Aug 26 21:03:07.420500 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value                                                                                                     
[Thu Aug 26 21:03:07.420502 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 1576, in _autoflush                     
[Thu Aug 26 21:03:07.420504 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self.flush()                                                                                                     
[Thu Aug 26 21:03:07.420506 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2451, in flush                          
[Thu Aug 26 21:03:07.420507 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self._flush(objects)                                                                                            
[Thu Aug 26 21:03:07.420509 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2589, in _flush                         
[Thu Aug 26 21:03:07.420511 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     transaction.rollback(_capture_exception=True)                                                                    
[Thu Aug 26 21:03:07.420513 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__                    
[Thu Aug 26 21:03:07.420515 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     compat.reraise(exc_type, exc_value, exc_tb)                                                                      
[Thu Aug 26 21:03:07.420516 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise                         
[Thu Aug 26 21:03:07.420518 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value                                                                                                     
[Thu Aug 26 21:03:07.420520 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2549, in _flush                         
[Thu Aug 26 21:03:07.420522 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     flush_context.execute()                                                                                         
[Thu Aug 26 21:03:07.420523 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute                      
[Thu Aug 26 21:03:07.420525 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     rec.execute(self)                                                                                               
[Thu Aug 26 21:03:07.420527 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute                      
[Thu Aug 26 21:03:07.420531 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     uow,                                                                                                            
[Thu Aug 26 21:03:07.420533 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj                    
[Thu Aug 26 21:03:07.420535 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     insert,                                                                                                         
[Thu Aug 26 21:03:07.420536 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1120, in _emit_insert_statements    
[Thu Aug 26 21:03:07.420538 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     statement, params                                                                                               
[Thu Aug 26 21:03:07.420540 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 988, in execute                         
[Thu Aug 26 21:03:07.420542 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return meth(self, multiparams, params)                                                                          
[Thu Aug 26 21:03:07.420544 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection         
[Thu Aug 26 21:03:07.420546 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return connection._execute_clauseelement(self, multiparams, params)                                             
[Thu Aug 26 21:03:07.420548 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement         
[Thu Aug 26 21:03:07.420550 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     distilled_params,                                                                                               
[Thu Aug 26 21:03:07.420552 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context                
[Thu Aug 26 21:03:07.420555 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     e, statement, parameters, cursor, context                                                                       
[Thu Aug 26 21:03:07.420558 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception        
[Thu Aug 26 21:03:07.420561 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     util.raise_from_cause(sqlalchemy_exception, exc_info)                                                           
[Thu Aug 26 21:03:07.420563 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause                
[Thu Aug 26 21:03:07.420566 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     reraise(type(exception), exception, tb=exc_tb, cause=cause)                                                     
[Thu Aug 26 21:03:07.420569 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 128, in reraise                         
[Thu Aug 26 21:03:07.420572 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value.with_traceback(tb)                                                                                  
[Thu Aug 26 21:03:07.420573 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context               
[Thu Aug 26 21:03:07.420575 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor, statement, parameters, context                                                                          
[Thu Aug 26 21:03:07.420578 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute                   
[Thu Aug 26 21:03:07.420581 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor.execute(statement, parameters)                                                                           
[Thu Aug 26 21:03:07.420586 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush
block if this flush is occurring prematurely)                                                                                                                                                                                   
[Thu Aug 26 21:03:07.420588 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] (psycopg2.IntegrityError) duplicate key value violates unique constraint "ix_pagure_orphan_reason_pagure_orphan_reaso
n_project_id"                                                                                                                                                                                                                   
[Thu Aug 26 21:03:07.420590 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] DETAIL:  Key (project_id)=(38613) already exists.                                                                   
[Thu Aug 26 21:03:07.420592 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                                                                     
[Thu Aug 26 21:03:07.420606 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] [SQL: INSERT INTO pagure_orphan_reason (project_id, reason, reason_info) VALUES (%(project_id)s, %(reason)s, %(reason
_info)s) RETURNING pagure_orphan_reason.id]                                                                                                                                                                                     
[Thu Aug 26 21:03:07.420612 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] [parameters: {'project_id': 38613, 'reason': 'Important bug not fixed', 'reason_info': 'https://bugzilla.redhat.com/1
976454%22'}]                                                                                                                                                                                                                    
[Thu Aug 26 21:03:07.420616 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] (Background on this error at: http://sqlalche.me/e/gkpj)                                                            
[Thu Aug 26 21:03:07.420627 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                                                                     
[Thu Aug 26 21:03:07.421278 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] 2021-08-26 21:03:07,420 [ERROR] pagure.api: 400                                                                     
[Thu Aug 26 21:03:07.421297 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] Traceback (most recent call last):                                                                                  
[Thu Aug 26 21:03:07.421300 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context               
[Thu Aug 26 21:03:07.421302 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor, statement, parameters, context                                                                          
[Thu Aug 26 21:03:07.421304 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute                   
[Thu Aug 26 21:03:07.421306 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor.execute(statement, parameters)                                                                           
[Thu Aug 26 21:03:07.421308 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] psycopg2.IntegrityError: duplicate key value violates unique constraint "ix_pagure_orphan_reason_pagure_orphan_reason
_project_id"                                                                                                                                                                                                                    
[Thu Aug 26 21:03:07.421311 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] DETAIL:  Key (project_id)=(38613) already exists.                                                                   
[Thu Aug 26 21:03:07.421313 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                                                                     
[Thu Aug 26 21:03:07.421314 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                                                                     
[Thu Aug 26 21:03:07.421317 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] The above exception was the direct cause of the following exception:                                                
[Thu Aug 26 21:03:07.421322 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                               
[Thu Aug 26 21:03:07.421322 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]                                                                                                                     
[Thu Aug 26 21:03:07.421345 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] Traceback (most recent call last):                                                                                  
[Thu Aug 26 21:03:07.421354 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure_distgit/plugin.py", line 310, in orphan_endpoint                    
[Thu Aug 26 21:03:07.421357 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     flask.g.session, repo, user_obj.username, "-1"                                                                  
[Thu Aug 26 21:03:07.421367 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 4697, in update_watch_status                    
[Thu Aug 26 21:03:07.421372 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     user_obj = get_user(session, user)                                                                              
[Thu Aug 26 21:03:07.421376 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 126, in get_user                                
[Thu Aug 26 21:03:07.421384 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     user_obj = search_user(session, username=key)                                                                   
[Thu Aug 26 21:03:07.421386 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 215, in search_user                             
[Thu Aug 26 21:03:07.421388 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     output = query.first()
[Thu Aug 26 21:03:07.421391 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3215, in first
[Thu Aug 26 21:03:07.421396 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     ret = list(self[0:1])
[Thu Aug 26 21:03:07.421406 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3007, in __getitem__
[Thu Aug 26 21:03:07.421413 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return list(res)
[Thu Aug 26 21:03:07.421420 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3316, in __iter__
[Thu Aug 26 21:03:07.421426 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self.session._autoflush()
[Thu Aug 26 21:03:07.421434 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 1587, in _autoflush
[Thu Aug 26 21:03:07.421438 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     util.raise_from_cause(e)
[Thu Aug 26 21:03:07.421450 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
[Thu Aug 26 21:03:07.421452 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     reraise(type(exception), exception, tb=exc_tb, cause=cause)
[Thu Aug 26 21:03:07.421455 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
[Thu Aug 26 21:03:07.421457 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value
[Thu Aug 26 21:03:07.421460 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 1576, in _autoflush
[Thu Aug 26 21:03:07.421463 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self.flush()
[Thu Aug 26 21:03:07.421467 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2451, in flush
[Thu Aug 26 21:03:07.421478 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self._flush(objects)
[Thu Aug 26 21:03:07.421479 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2589, in _flush
[Thu Aug 26 21:03:07.421482 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     transaction.rollback(_capture_exception=True)
[Thu Aug 26 21:03:07.421489 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
[Thu Aug 26 21:03:07.421533 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     compat.reraise(exc_type, exc_value, exc_tb)
[Thu Aug 26 21:03:07.421536 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
[Thu Aug 26 21:03:07.421540 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value
[Thu Aug 26 21:03:07.421542 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2549, in _flush
[Thu Aug 26 21:03:07.421544 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     flush_context.execute()
[Thu Aug 26 21:03:07.421546 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
[Thu Aug 26 21:03:07.421551 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     rec.execute(self)
[Thu Aug 26 21:03:07.421579 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
[Thu Aug 26 21:03:07.421615 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     uow,
[Thu Aug 26 21:03:07.421630 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
[Thu Aug 26 21:03:07.421632 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     insert,
[Thu Aug 26 21:03:07.421636 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1120, in _emit_insert_statements
[Thu Aug 26 21:03:07.421658 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     statement, params
[Thu Aug 26 21:03:07.421677 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 988, in execute
[Thu Aug 26 21:03:07.421695 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return meth(self, multiparams, params)
[Thu Aug 26 21:03:07.421697 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
[Thu Aug 26 21:03:07.421701 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return connection._execute_clauseelement(self, multiparams, params)
[Thu Aug 26 21:03:07.421723 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
[Thu Aug 26 21:03:07.421741 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     distilled_params,
[Thu Aug 26 21:03:07.421745 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
[Thu Aug 26 21:03:07.421747 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     e, statement, parameters, cursor, context
[Thu Aug 26 21:03:07.421752 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
[Thu Aug 26 21:03:07.421775 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     util.raise_from_cause(sqlalchemy_exception, exc_info)
[Thu Aug 26 21:03:07.421799 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
[Thu Aug 26 21:03:07.421814 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     reraise(type(exception), exception, tb=exc_tb, cause=cause)
[Thu Aug 26 21:03:07.421816 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 128, in reraise
[Thu Aug 26 21:03:07.421820 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value.with_traceback(tb)
[Thu Aug 26 21:03:07.421842 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
[Thu Aug 26 21:03:07.421859 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor, statement, parameters, context
[Thu Aug 26 21:03:07.421879 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
[Thu Aug 26 21:03:07.421884 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor.execute(statement, parameters)
[Thu Aug 26 21:03:07.421904 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush
block if this flush is occurring prematurely)
[Thu Aug 26 21:03:07.421907 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] (psycopg2.IntegrityError) duplicate key value violates unique constraint "ix_pagure_orphan_reason_pagure_orphan_reaso
n_project_id"
[Thu Aug 26 21:03:07.421911 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] DETAIL:  Key (project_id)=(38613) already exists.
[Thu Aug 26 21:03:07.421933 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.421954 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] [SQL: INSERT INTO pagure_orphan_reason (project_id, reason, reason_info) VALUES (%(project_id)s, %(reason)s, %(reason
_info)s) RETURNING pagure_orphan_reason.id]
[Thu Aug 26 21:03:07.421956 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] [parameters: {'project_id': 38613, 'reason': 'Important bug not fixed', 'reason_info': 'https://bugzilla.redhat.com/1
976454%22'}]
[Thu Aug 26 21:03:07.421959 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] (Background on this error at: http://sqlalche.me/e/gkpj)
[Thu Aug 26 21:03:07.421964 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.421986 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] During handling of the above exception, another exception occurred:
[Thu Aug 26 21:03:07.422007 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.422011 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] Traceback (most recent call last):
[Thu Aug 26 21:03:07.422030 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/api/__init__.py", line 257, in wrapper
[Thu Aug 26 21:03:07.422033 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     result = function(*args, **kwargs)
[Thu Aug 26 21:03:07.422035 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure_distgit/plugin.py", line 316, in orphan_endpoint
[Thu Aug 26 21:03:07.422038 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise pagure.exceptions.APIError(400, error_code=APIERROR.EDBERROR)
[Thu Aug 26 21:03:07.422046 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] pagure.exceptions.APIError: 400
[Thu Aug 26 21:03:07.422060 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.422116 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] [2021-08-26 21:03:07,420] ERROR in __init__: 400
[Thu Aug 26 21:03:07.422124 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] Traceback (most recent call last):
[Thu Aug 26 21:03:07.422126 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
[Thu Aug 26 21:03:07.422128 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor, statement, parameters, context
[Thu Aug 26 21:03:07.422130 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
[Thu Aug 26 21:03:07.422132 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor.execute(statement, parameters)
[Thu Aug 26 21:03:07.422134 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] psycopg2.IntegrityError: duplicate key value violates unique constraint "ix_pagure_orphan_reason_pagure_orphan_reason
_project_id"
[Thu Aug 26 21:03:07.422136 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] DETAIL:  Key (project_id)=(38613) already exists.
[Thu Aug 26 21:03:07.422138 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.422140 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.422142 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] The above exception was the direct cause of the following exception:
[Thu Aug 26 21:03:07.422144 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.422146 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] Traceback (most recent call last):
[Thu Aug 26 21:03:07.422150 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure_distgit/plugin.py", line 310, in orphan_endpoint
[Thu Aug 26 21:03:07.422178 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     flask.g.session, repo, user_obj.username, "-1"
[Thu Aug 26 21:03:07.422181 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 4697, in update_watch_status
[Thu Aug 26 21:03:07.422183 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     user_obj = get_user(session, user)
[Thu Aug 26 21:03:07.422194 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 126, in get_user
[Thu Aug 26 21:03:07.422220 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     user_obj = search_user(session, username=key)
[Thu Aug 26 21:03:07.422239 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 215, in search_user
[Thu Aug 26 21:03:07.422242 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     output = query.first()
[Thu Aug 26 21:03:07.422244 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3215, in first
[Thu Aug 26 21:03:07.422249 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     ret = list(self[0:1])
[Thu Aug 26 21:03:07.422275 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3007, in __getitem__
[Thu Aug 26 21:03:07.422290 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return list(res)
[Thu Aug 26 21:03:07.422292 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3316, in __iter__
[Thu Aug 26 21:03:07.422296 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self.session._autoflush()
[Thu Aug 26 21:03:07.422315 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 1587, in _autoflush
[Thu Aug 26 21:03:07.422318 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     util.raise_from_cause(e)
[Thu Aug 26 21:03:07.422320 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
[Thu Aug 26 21:03:07.422323 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     reraise(type(exception), exception, tb=exc_tb, cause=cause)
[Thu Aug 26 21:03:07.422327 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
[Thu Aug 26 21:03:07.422347 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value
[Thu Aug 26 21:03:07.422350 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 1576, in _autoflush
[Thu Aug 26 21:03:07.422353 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self.flush()
[Thu Aug 26 21:03:07.422355 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2451, in flush
[Thu Aug 26 21:03:07.422357 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     self._flush(objects)
[Thu Aug 26 21:03:07.422359 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2589, in _flush
[Thu Aug 26 21:03:07.422362 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     transaction.rollback(_capture_exception=True)
[Thu Aug 26 21:03:07.422364 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
[Thu Aug 26 21:03:07.422366 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     compat.reraise(exc_type, exc_value, exc_tb)
[Thu Aug 26 21:03:07.422371 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
[Thu Aug 26 21:03:07.422403 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value
[Thu Aug 26 21:03:07.422424 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/session.py", line 2549, in _flush
[Thu Aug 26 21:03:07.422443 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     flush_context.execute()
[Thu Aug 26 21:03:07.422445 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
[Thu Aug 26 21:03:07.422449 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     rec.execute(self)
[Thu Aug 26 21:03:07.422473 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
[Thu Aug 26 21:03:07.422486 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     uow,
[Thu Aug 26 21:03:07.422489 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
[Thu Aug 26 21:03:07.422493 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     insert,
[Thu Aug 26 21:03:07.422496 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1120, in _emit_insert_statements
[Thu Aug 26 21:03:07.422502 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     statement, params
[Thu Aug 26 21:03:07.422518 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 988, in execute
[Thu Aug 26 21:03:07.422520 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return meth(self, multiparams, params)
[Thu Aug 26 21:03:07.422523 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
[Thu Aug 26 21:03:07.422527 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     return connection._execute_clauseelement(self, multiparams, params)
[Thu Aug 26 21:03:07.422547 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
[Thu Aug 26 21:03:07.422550 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     distilled_params,
[Thu Aug 26 21:03:07.422555 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
[Thu Aug 26 21:03:07.422561 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     e, statement, parameters, cursor, context
[Thu Aug 26 21:03:07.422582 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
[Thu Aug 26 21:03:07.422585 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     util.raise_from_cause(sqlalchemy_exception, exc_info)
[Thu Aug 26 21:03:07.422589 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
[Thu Aug 26 21:03:07.422600 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     reraise(type(exception), exception, tb=exc_tb, cause=cause)
[Thu Aug 26 21:03:07.422611 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 128, in reraise
[Thu Aug 26 21:03:07.422632 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise value.with_traceback(tb)
[Thu Aug 26 21:03:07.422656 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
[Thu Aug 26 21:03:07.422675 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor, statement, parameters, context
[Thu Aug 26 21:03:07.422690 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
[Thu Aug 26 21:03:07.422698 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     cursor.execute(statement, parameters)
[Thu Aug 26 21:03:07.422711 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] sqlalchemy.exc.IntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush
block if this flush is occurring prematurely)
[Thu Aug 26 21:03:07.422714 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] (psycopg2.IntegrityError) duplicate key value violates unique constraint "ix_pagure_orphan_reason_pagure_orphan_reaso
n_project_id"
[Thu Aug 26 21:03:07.422717 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] DETAIL:  Key (project_id)=(38613) already exists.
[Thu Aug 26 21:03:07.422719 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.422723 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] [SQL: INSERT INTO pagure_orphan_reason (project_id, reason, reason_info) VALUES (%(project_id)s, %(reason)s, %(reason
_info)s) RETURNING pagure_orphan_reason.id]
[Thu Aug 26 21:03:07.422745 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] [parameters: {'project_id': 38613, 'reason': 'Important bug not fixed', 'reason_info': 'https://bugzilla.redhat.com/1
976454%22'}]
[Thu Aug 26 21:03:07.422760 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] (Background on this error at: http://sqlalche.me/e/gkpj)
[Thu Aug 26 21:03:07.422762 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.422764 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] During handling of the above exception, another exception occurred:
[Thu Aug 26 21:03:07.422767 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]
[Thu Aug 26 21:03:07.422769 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] Traceback (most recent call last):
[Thu Aug 26 21:03:07.422771 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure/api/__init__.py", line 257, in wrapper
[Thu Aug 26 21:03:07.422776 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     result = function(*args, **kwargs)
[Thu Aug 26 21:03:07.422778 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]   File "/usr/lib/python3.6/site-packages/pagure_distgit/plugin.py", line 316, in orphan_endpoint
[Thu Aug 26 21:03:07.422780 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]     raise pagure.exceptions.APIError(400, error_code=APIERROR.EDBERROR)
[Thu Aug 26 21:03:07.422783 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724] pagure.exceptions.APIError: 400
[Thu Aug 26 21:03:07.422793 2021] [wsgi:error] [pid 3712611:tid 140122190939904] [remote 10.3.163.74:51724]

So, might be that the reason has to be unique? Try changing the reason? add 'because of another case of bug...' ?

@pingou any further ideas?

Changing the reason does not help.

Funnily enough, I can orphan other packages via API.

But not this one.

$ PAGURE_TOKEN=xxxxxxxxxx python orphan-listed-packages.py 
**** REQUEST FAILED
  - Orphan package
https://src.fedoraproject.org/_dg/orphan/rpms/python-cocotb
{'orphan_reason': 'Important bug not fixed', 'orphan_reason_info': 'https://bugzilla.redhat.com/1976454'}
{'Authorization': 'token xxxxxxxxxx'}
{
  "error": "An error occurred at the database level and prevent the action from reaching completion", 
  "error_code": "EDBERROR"
}

  tc01 has no longer a bugzilla overrides on rpms/python-cocotb

I can also orphan other packages via the web interface, but not python-cocotb.

I think the error in the traceback is about the project_id key is already in the association table with the reason of orphaning.
That specific package was orphaned before, so I suspect that unique key is misconfigured and prevents packages from being orphaned more than once.

But I cannot find anywhere (pagure source code or ansible repository) the code responsible for that.

In the meantime, I've orphaned the package the old way: by setting orphan as the main admin.

I think the error in the traceback is about the project_id key is already in the association table with the reason of orphaning.
That specific package was orphaned before, so I suspect that unique key is misconfigured and prevents packages from being orphaned more than once.

But I cannot find anywhere (pagure source code or ansible repository) the code responsible for that.

I guess it's in the pagure-dist-git project on pagure.io

I think the error in the traceback is about the project_id key is already in the association table with the reason of orphaning.
That specific package was orphaned before, so I suspect that unique key is misconfigured and prevents packages from being orphaned more than once.

But I cannot find anywhere (pagure source code or ansible repository) the code responsible for that.

I guess it's in the pagure-dist-git project on pagure.io

Yep, it is.

The orphan_reason should be deleted when the package gets unorphaned:
https://pagure.io/pagure-dist-git/blob/master/f/pagure_distgit/plugin.py#_379
so I guess there's a db corruption (that explain why we didn't saw this error before).

BTW if you want a testing environment for the fix, orphaning https://src.stg.fedoraproject.org/rpms/0ad displays the same error message.

The code I linked in https://pagure.io/fedora-infrastructure/issue/10181#comment-750545 that correctly removes the orphaning reason in the database when a package is taken was introduced in the plugin only 10 months ago in version 1.10.0.

So I suspect every project that was un-orphaned before that release have a wrong leftover in the orphaning reason table.
It will need an admin to fix that in the db, by looking all projects that are not orphaned, but that still have an orphaning reason set.

So, that table has:

(1894 rows)

Can someone more versed in sql give me something that will work to figure out which of those projects are not orphaned? :)

I also can't see where to tell if a project is orphaned... it's not in the main 'project' table that I can see.

So, that table has:

(1894 rows)

Can someone more versed in sql give me something that will work to figure out which of those projects are not orphaned? :)

I also can't see where to tell if a project is orphaned... it's not in the main 'project' table that I can see.

I'm not a SQL expert too, so take the following lines with caution.

This query should list all projects with an entry in pagure_orphan_reason which aren't assigned to the orphan user:

SELECT orphans.id, projects.name, users.user
FROM pagure_orphan_reason AS orphans
JOIN projects ON orphans.project_id=projects.id
JOIN users ON projects.user_id=users.id
WHERE users.user!='orphan'

If that query result looks fine, then the following query will delete all the spurious entries:

DELETE FROM pagure_orphan_reason
WHERE id IN
(SELECT orphans.id
FROM pagure_orphan_reason AS orphans
JOIN projects ON orphans.project_id=projects.id
JOIN users ON projects.user_id=users.id
WHERE users.user!='orphan')

Thanks. :)

first query:

  id  |          name           |      user       
------+-------------------------+-----------------
 2162 | sugar-view-slides       | chimosky
 2168 | python-aenum            | pbrobinson
 1962 | xorg-x11-drv-nouveau    | ajax
  932 | maven-verifier          | mizdebsk
 2169 | python-jsons            | fab
    6 | exaile                  | grahamwhiteuk
 1888 | irqbalance              | walters
   18 | biblesync               | greghellings
 1884 | dropwatch               | liuhangbin
  875 | python-flask-mail       | ngompa
   37 | fillets-ng              | nickysn
 2239 | rhino                   | didiksupriadi41
   66 | jblas                   | zbyszek
 1005 | lv2-c++-tools           | tartina
  796 | lzma-sdk                | rathann
 1918 | coffee-script           | vondruch
 2557 | perl-WebService-Dropbox | martinkg
  922 | tdlib                   | alexfails
  894 | sofia-sip               | torbuntu
 2135 | rust-rusttype           | decathorpe
 1877 | xpp3                    | sbluhm
 2136 | rust-andrew             | decathorpe
   63 | icemon                  | jankratochvil
 1927 | icebreaker              | mattdm
 1934 | manifest-tool           | jwboyer
 1690 | xrefresh                | dcavalca
  629 | oggvideotools           | zbyszek
  591 | nodejs-typescript       | carlwgeorge
  902 | cri-tools               | haircommander
  705 | samdump2                | rebus
   25 | dc3dd                   | rebus
  663 | rust-proc-quote         | decathorpe
  964 | python-rpm-generators   | torsava
   82 | libemu                  | rebus
 1901 | xstdcmap                | dcavalca
 1081 | cri-o                   | haircommander
  994 | fedora-jam-backgrounds  | q5sys
  995 | fedora-jam-kde-theme    | q5sys
  706 | shutter                 | martinkg
 2024 | jakarta-activation      | mizdebsk
  662 | rust-nalgebra           | remilauzier
 2216 | python-mdx_gh_links     | smani
 2215 | python-lunr             | smani
(43 rows)

Do all those look ok ? From a quick glance it seems so to me...

The package list seems ok and it should be safe running the second query.

However, in the list I see some packages that were unretired recently, yet they still have an entry in the orphan_reason table. That doesn't seem correct regarding what I wrote in https://pagure.io/fedora-infrastructure/issue/10181#comment-750665.

For example, rhino was unorphaned just one month ago, so the orphan reason should have bee removed from the table as the updated code do so.
The only explanation I can think about is that, from what I see, rhino was manually unorphaned by releng (https://pagure.io/releng/issue/10341). Maybe the user who adopted the package didn't click on the "take" button in pagure, but rather the db was manually edited by releng to assign the package to the user? If so, we should make releng avoid doing this kind of operation...

Hi, @mattia I did the unretirement and it was not done manually. There is a script in releng repo that changes the owner of the project using HTTP PATCH method to update the main_admin of the.

Hi, @mattia I did the unretirement and it was not done manually. There is a script in releng repo that changes the owner of the project using HTTP PATCH method to update the main_admin of the.

Ah, thanks. So that script should be modified to not only change the package owner, but also to remove the record in the orphan_reason table.
Or maybe we should modify the take_orphan endpoint in pagure-dist-git plugin to accept a username parameter if the request comes from an admin.

ok, I ran the second sql there and it deleted those 43 entries.

I guess if we need to adjust releng tools we should file a ticket to track that?

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

9 months ago

Login to comment on this ticket.

Metadata
Boards 1
ops Status: Backlog