Closed Bug 1199385 Opened 10 years ago Closed 10 years ago

delete stale users from pulse.m.o

Categories

(Webtools :: Pulse, defect)

defect
Not set
normal

Tracking

(firefox43 affected)

VERIFIED FIXED
Tracking Status
firefox43 --- affected

People

(Reporter: bhearsum, Unassigned)

References

Details

I created and then deleted a few users awhile back, but it looks like they're still stuck in the system, owned by "None". I'm hoping to re-use one of the names, so it would be great to get them cleaned up. The users are "bhearsum-bbb", "bheasum-publisher", and "buildbot-bridge-dev"
cyliang: could you look for those users in the pulse_users table (username field), and let me know what entry/ies in the users table they are associated with?
Flags: needinfo?(cliang)
Also, I tried reproducing this with the user "mcote-pulse-test". I wasn't able to--the user was removed from both Pulse and PulseGuardian--but I did get an error. Could you check in the logs for the last few minutes and see if you see anything about that?
Hm we also have two users with "None" as their username. Perhaps empty usernames? Could you check for something like that too?
RE: the accounts bhearsum asked about bhearsum-bbb id 99, owner_id = NULL bhearsum-publisher id 108, owner_id = NULL buildbot-bridge-dev id 100, owner_id = NULL -- RE: log entries about mcote-pulse-test In log_web_guardian.log, there is: 2015-08-31 18:42:18 - INFO: Request to delete Pulse user "mcote-pulse-test". 2015-08-31 18:42:18 - INFO: Request to delete Pulse user "mcote-pulse-test". 2015-08-31 18:42:18 - INFO: Starting new HTTP connection (1): pulse-rabbit1.dmz.phx1.mozilla.com 2015-08-31 18:42:18 - INFO: Starting new HTTP connection (1): pulse-rabbit1.dmz.phx1.mozilla.com 2015-08-31 18:42:18 - INFO: Pulse user "mcote-pulse-test" deleted. 2015-08-31 18:42:18 - WARNING: Couldn't delete user 'mcote-pulse-test' on rabbitmq: Error when calling 'DELETE users/mcote-pulse-test' with data=None. Received: <html><head><title>500 Internal Server Error</title></head><body><h1>Internal Server Error</h1>The server encountered an error while processing this request:<br><pre>{throw,{error,{no_such_user,<<"mcote-pulse-test">>}}, [{rabbit_misc,execute_mnesia_transaction,1}, {rabbit_mgmt_wm_user,delete_resource,2}, {webmachine_resource,resource_call,3}, {webmachine_resource,do,3}, {webmachine_decision_core,resource_call,1}, {webmachine_decision_core,decision,1}, {webmachine_decision_core,handle_request,2}, {rabbit_webmachine,'-makeloop/1-fun-0-',2}]}</pre><P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></body></html> --- RE: Usernames of "none" I found one entry in pulse_users where the username was set to null: +----+----------+----------+ | id | owner_id | username | +----+----------+----------+ | 31 | NULL | NULL | +----+----------+----------+ And another entry where the username file is explicitly set to "None": +-----+----------+----------+ | id | owner_id | username | +-----+----------+----------+ | 119 | NULL | None | +-----+----------+----------+
Flags: needinfo?(cliang)
Huh looks like maybe it's sending the request twice. That doesn't explain why there are abandoned users though... oh well. cyliang can you delete all those pulse_users (31, 99, 100, 108, and 119)?
Flags: needinfo?(cliang)
I was only able to delete the pulse_user entry for id 119. Everything else gave a foreign key constraint error. [1] Do you want me to delete the queues as well? Queues that are tied to users: mysql> select * from queues where owner_id = 31; +---------------------------------------------------------------------------+----------+------+--------+ | name | owner_id | size | warned | +---------------------------------------------------------------------------+----------+------+--------+ | queue/jonasfj-debug/worker/v1/no-provisioning-nope/1Fp3N3vJSBeFQUQqXwyo3g | 31 | 0 | NULL | | queue/jonasfj-debug/worker/v1/no-provisioning-nope/N9oNgaNgQuuh8Zdm7_tsTg | 31 | 0 | NULL | | queue/jonasfj-debug/worker/v1/no-provisioning-nope/OOPcMa4TTjSwFfabZsl3_w | 31 | 0 | NULL | +---------------------------------------------------------------------------+----------+------+--------+ 3 rows in set (0.00 sec) mysql> select * from queues where owner_id = 99; +-----------------------------------+----------+------+--------+ | name | owner_id | size | warned | +-----------------------------------+----------+------+--------+ | queue/bhearsum-bbb/log_uploaded | 99 | 4 | NULL | | queue/bhearsum-bbb/started | 99 | 4 | NULL | | queue/bhearsum-bbb/task-exception | 99 | 0 | NULL | | queue/bhearsum-bbb/task-pending | 99 | 0 | NULL | +-----------------------------------+----------+------+--------+ 4 rows in set (0.00 sec) mysql> select * from queues where owner_id = 108; +-----------------------------------------+----------+------+--------+ | name | owner_id | size | warned | +-----------------------------------------+----------+------+--------+ | queue/bhearsum-publisher/log_uploaded | 108 | 0 | NULL | | queue/bhearsum-publisher/started | 108 | 0 | NULL | | queue/bhearsum-publisher/task-exception | 108 | 0 | NULL | | queue/bhearsum-publisher/task-pending | 108 | 0 | NULL | +-----------------------------------------+----------+------+--------+ 4 rows in set (0.00 sec) mysql> select * from queues where owner_id = 100; +------------------------------------------+----------+------+--------+ | name | owner_id | size | warned | +------------------------------------------+----------+------+--------+ | queue/buildbot-bridge-dev/log_uploaded | 100 | 4 | NULL | | queue/buildbot-bridge-dev/started | 100 | 4 | NULL | | queue/buildbot-bridge-dev/task-exception | 100 | 5 | NULL | | queue/buildbot-bridge-dev/task-pending | 100 | 2 | NULL | +------------------------------------------+----------+------+--------+ 4 rows in set (0.00 sec) [1] mysql> delete from pulse_users where id =31; ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`pulseguardian`.`queues`, CONSTRAINT `queues_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `pulse_users` (`id`))
Flags: needinfo?(cliang)
I can't see these queues in the UI. The ones with my name on them from the previous comment can go though.
Okay most of those queues did still exist on Pulse, although it looks like they have been inactive for a long time. I deleted all of them. Cy, can you remove the queues you listed from the database along with the aforementioned pulse_users entries? I'm still not sure of the root cause here, but it may have been related to the last Pulse outage, with PulseGuardian somehow getting out of sync. I realized some of these NULL entries may be from PulseGuardian finding the queues but there being no user connected to them, and hence no way to determine their creator.
Flags: needinfo?(cliang)
The queue entries in the database look like they deleted themselves. I was able to remove the entries in pulse_users.
Flags: needinfo?(cliang)
Ah yes, PulseGuardian would have picked up their disappearance. Thanks! Looks like we're done here.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Thanks!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.