Skip to main content

Database Owner Already Exists?

Comments

12 comments

  • cPanelLauren
    Is anything with that username located at /var/cpanel/databases/
    ? Where was the database you removed? In /var/lib/mysql
    ?
    0
  • whipworks
    /var/cpanel/databases/username.json
    0
  • cPanelLauren
    If you remove that file does the transfer take place without issue?
    0
  • whipworks
    It still gives out an error even after removing it. A different one.
    0
  • cPanelLauren
    @whipworks The following is an internal tool we use to find account cruft. Could you run this and see if anything comes up for the username? /usr/local/cpanel/3rdparty/bin/perl <(curl -s https://raw.githubusercontent.com/cPanelInc/tech-acctinfo/master/acctinfo) $USER
    I'd expect to see all "NOT FOUND" for an account that doesn't exist on the server.
    0
  • mathx
    tech dude here: Little scary to run a script inline from the web, but downloaded it, looks legit (...i think...) ran it with --cruft: obviously shows some spurious cruft - how to safely remove? #./acctinfo --cruft username acctinfo - Version: 2.5.15 ============================================================================================== CRUFT CHECK ============================================================================================== From your query of username I have determined: userdomain.com (username) was terminated on Tue Apr 30 12:17:04 2019 ---------------------------------------------------------------------------------------------- Searching the following files for user: username /etc/passwd [MISSING] /etc/group [MISSING] /etc/shadow [MISSING] /etc/gshadow [MISSING] /etc/quota.conf [MISSING] /etc/dbowners [MISSING] /etc/trueuserowners [MISSING] /var/cpanel/databases/users.db is either empty or missing [SKIPPING] /etc/userdatadomains.json [EXISTS] /var/cpanel/quotawarned [MISSING] /etc/nocgiusers [MISSING] /etc/userips [MISSING] /etc/userbwlimits [MISSING] Searching the following files for domain: userdomain.com /etc/userdomains [EXISTS] /etc/trueuserdomains [EXISTS] /etc/userdatadomains [EXISTS] /etc/domainusers [EXISTS] /etc/localdomains [EXISTS] /etc/remotedomains [MISSING] /etc/demousers is either empty or missing [SKIPPING] /etc/email_send_limits [EXISTS] /etc/demoids is either empty or missing [SKIPPING] /etc/demodomains is either empty or missing [SKIPPING] /etc/ssldomains is either empty or missing [SKIPPING] /home/username [MISSING] Checking other possible home directory locations... /home1/username [MISSING] /home2/username [MISSING] /home3/username [MISSING] /home4/username [MISSING] /home5/username [MISSING] /home6/username [MISSING] /home7/username [MISSING] /home8/username [MISSING] /home9/username [MISSING] /var/cpanel/userdata/username [EXISTS] \_ /var/cpanel/userdata/username/main \_ /var/cpanel/userdata/username/wholesaledsl.userdomain.com /var/cpanel/users/username [EXISTS] \_ [WARN]: One or more DNS lines may be missing from this file! /var/cpanel/databases/grants_username.yaml [MISSING] /var/cpanel/databases/username.json [MISSING] /var/cpanel/databases/dbindex.db.json [MISSING] /etc/proftpd/username [MISSING] /var/cpanel/bandwidth/username.sqlite [MISSING] /var/cpanel/bwlimited/username [MISSING] /var/cpanel/bwlimited/userdomain.com [MISSING] /etc/valiases/userdomain.com [MISSING] /etc/vfilters/userdomain.com [MISSING] /etc/vdomainaliases/userdomain.com [MISSING] /var/named/userdomain.com.db [MISSING] /etc/apache2/logs/domlogs/userdomain.com [MISSING] /etc/named.conf [MISSING] /etc/apache2/conf/httpd.conf [EXISTS] Checking for any MySQL users in mysql.user table \_ username_bookmar \_ username_faq \_ username_switcha \_ username_wp1 \_ username_wp2 \_ username_wp3 \_ username_wpusr \_ username Checking for any MySQL users and databases in mysql.db table \_ username_switcha username\\_userdomain \_ username_wp2 username\\_wp1 \_ username_wp3 username\\_wp2 \_ username cptmpdb\\_username\\_i76lfu4o0C6GMTnX \_ username username\\_wp1 \_ username username\\_userdomain \_ username username\\_admin\\_faq \_ username username\\_wp2 \_ username username\\_admin\\_bookmarks ==============================================================================================
    0
  • cPanelLauren
    tech dude here: Little scary to run a script inline from the web, but downloaded it, looks legit (...i think...) ran it with --cruft:

    Understood, though I can assure you that this has been tested and is something we wrote and use internally, though it is entirely up to you to run it, the full source as you can see is in github and readily available. For the cruft information - It looks like there's a few spots it didn't get removed cleanly: These two can be removed: \_ /var/cpanel/userdata/username/main \_ /var/cpanel/userdata/username/wholesaledsl.userdomain.com
    Once you remove them you'd want to run the following: /scripts/updateuserdomains /scripts/updateuserdatacache
    Once that's complete you would want to rebuild the apache configuration so that the entry is no longer present: First make a copy: mv /etc/apache2/conf/httpd.conf{,.bk}
    then rebuild/restart: /scripts/rebuildhttpdconf /scripts/restartsrv_httpd
    For the users: Checking for any MySQL users in mysql.user table \_ username_bookmar \_ username_faq \_ username_switcha \_ username_wp1 \_ username_wp2 \_ username_wp3 \_ username_wpusr \_ username
    If you go to WHM>>SQL Services>>Manage Database Users do the above users show up and if so are you able to edit them to modify the name to no longer include the user? If not you'd manually need to remove the user from MySQL Something like the following may be useful (using the first name in the list as an example): DROP USER 'username_bookmar'@'localhost';
    Thanks!
    0
  • mathx
    ok done all that, deleted mysql users, reran acctinfo. issue is there's a separate user for two other related accounts (this is for the hosting company itself) 'accounts.userdomain.com' and 'secure.userdomain.com' so I think acctinfo is triggering that some of this still exists: probably should be a grep -w $username and $userdomain on these files, not a plain grep which will match domains that contain the same characters: (grep -wlr username /etc/*domain* returns nil, whereas grep -lr username /etc/*domain* returns lots) CRUFT CHECK ============================================================================================== /etc/userdatadomains.json [EXISTS] Searching the following files for domain: userdomain.com /etc/userdomains [EXISTS] /etc/trueuserdomains [EXISTS] /etc/userdatadomains [EXISTS] /etc/domainusers [EXISTS] /etc/localdomains [EXISTS] /etc/email_send_limits [EXISTS] /var/cpanel/userdata/username [EXISTS] /var/cpanel/users/username [EXISTS] /etc/apache2/conf/httpd.conf [EXISTS] but /var/cpanel/userdata/username [EXISTS] /var/cpanel/users/username [EXISTS] is definitely correct. Should I delete those last 2?
    0
  • cPanelLauren
    I'm sorry, I missed that second one initially there, yes they should definitely be removed. Then run the same script: \_ /var/cpanel/userdata/username/main \_ /var/cpanel/userdata/username/wholesaledsl.userdomain.com
    Once you remove them you'd want to run the following: /scripts/updateuserdomains /scripts/updateuserdatacache
    Once that's complete you would want to rebuild the apache configuration so that the entry is no longer present: First make a copy: mv /etc/apache2/conf/httpd.conf{,.bk}
    then rebuild/restart: /scripts/rebuildhttpdconf /scripts/restartsrv_httpd
    0
  • whipworks
    Can we open a ticket to have this fixed please? Seems that all the scripts above isn't doing anything. We were trying to recover another account on the same server and it's showing the same issue. It's saying the account already exist.
    0
  • cPanelLauren
    Can we open a ticket to have this fixed please? Seems that all the scripts above isn't doing anything. We were trying to recover another account on the same server and it's showing the same issue. It's saying the account already exist.

    Hi @whipworks You're always more than welcome to open a ticket with us. We'd be happy to assist you with this issue.
    0
  • whipworks
    Support Request ID is: 13963625
    0

Please sign in to leave a comment.