Forums

Resolved
0 votes
I uninstalled and reinstalled the ownCloud for Home app and now when I'm at the OwnCloud X setup screen, I get an error "The username is already being used" and I can't get past this page.
Any suggestions to get past this?
I have no problem resetting everything.
I'd just like to get it working.
Thursday, August 30 2018, 02:41 AM
Share this post:
Responses (18)
  • Accepted Answer

    Saturday, September 01 2018, 03:45 AM - #Permalink
    Resolved
    0 votes
    Yes... that did it.
    Thanks so much Ben.
    Back up and running.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, September 01 2018, 02:44 AM - #Permalink
    Resolved
    0 votes
    Sorry.

    There was a typo (-i should have been -e to drop the db) and I missed deleting a very important file/folder that was leaving by an old autoconfig.php which would ruined things. Here's the updated delete script:

    yum remove owncloud-files
    rm -rf /etc/clearos/owncloud.conf
    rm -rf /usr/share/owncloud
    /usr/clearos/sandbox/usr/bin/mysql -uroot -p$(sed "s/password\s*=\s*//" < /var/clearos/system_database/root) -e "DROP DATABASE owncloud"
    rm -rf /var/clearos/system_database/owncloud
    rm -rf /var/clearos/owncloud
    rm -rf /etc/owncloud
    yum clean all
    yum install app-owncloud


    Does that help?
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, September 01 2018, 02:21 AM - #Permalink
    Resolved
    0 votes
    I'm not able to figure out how to get it working.
    I've "gone nuclear" and removed everything as described.
    I've dropped the owncloud database.
    But every time i reinstall it, I get the error on the owncloud config page:

    Error
    Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000][1045] Access denied for user 'owncloud'@'localhost' (using password: YES)


    Did some googling and found some instructions about granting privileges, but not really sure if that's correct.
    So, it's uninstalled for now.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, September 01 2018, 01:10 AM - #Permalink
    Resolved
    0 votes
    I tell you... I have no luck.
    Followed all the steps... now I see this on the ownCloud config page and can't get past it.

    Error
    Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000][1045] Access denied for user 'owncloud'@'localhost' (using password: YES)
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, September 01 2018, 12:56 AM - #Permalink
    Resolved
    0 votes
    Ok... google helped.

    [root@gateway /]# /usr/clearos/sandbox/usr/bin/mysql -uroot -p$(sed "s/password\s*=\s*//" < /var/clearos/system_database/root)
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 446
    Server version: 5.5.56-MariaDB MariaDB Server

    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]> show databases;
    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | mysql |
    | owncloud |
    | performance_schema |
    | reports |
    +--------------------+
    5 rows in set (0.00 sec)

    MariaDB [(none)]> drop database owncloud;
    Query OK, 54 rows affected (0.97 sec)

    MariaDB [(none)]> drop database owncloud;
    Query OK, 54 rows affected (0.97 sec)

    The reply is currently minimized Show
  • Accepted Answer

    Saturday, September 01 2018, 12:54 AM - #Permalink
    Resolved
    0 votes
    Not having that database is harmless...and quite likely the cause of some earlier issues (or maybe just a symptom).

    Go ahead with the install now.

    B

    PS: I think the mysql command you were looking for is 'show databases'.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, September 01 2018, 12:45 AM - #Permalink
    Resolved
    0 votes
    I don't really know what I'm doing but... Does this mean the database doesn't exist?

    usr/clearos/sandbox/usr/bin/mysql -uroot -p$(sed "s/password\s*=\s*//" < /var/clearos/system_database/root)
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 445
    Server version: 5.5.56-MariaDB MariaDB Server

    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]> select database();
    +------------+
    | database() |
    +------------+
    | NULL |
    +------------+
    1 row in set (0.03 sec)

    MariaDB [(none)]>
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, September 01 2018, 12:39 AM - #Permalink
    Resolved
    0 votes
    Yes... nuclear is what I want (everything is backed up)

    But, this is what I see now...

    /usr/clearos/sandbox/usr/bin/mysql -uroot -p$(sed "s/password\s*=\s*//" < /var/clearos/system_database/root) -i "DROP DATABASE owncloud"
    ERROR 1049 (42000): Unknown database 'DROP DATABASE owncloud'
    The reply is currently minimized Show
  • Accepted Answer

    Friday, August 31 2018, 12:43 PM - #Permalink
    Resolved
    0 votes
    Bryan,

    We've done dozens of upgrades in the lab before releasing the upgrade...Not sure what happened in your case. Since you mentioned you don't have any issue doing a complete reset, let's just go nuclear and start again.

    yum remove owncloud-files
    rm -rf /etc/clearos/owncloud.conf
    rm -rf /usr/share/owncloud
    /usr/clearos/sandbox/usr/bin/mysql -uroot -p$(sed "s/password\s*=\s*//" < /var/clearos/system_database/root) -e "DROP DATABASE owncloud"
    rm -rf /var/clearos/system_database/owncloud
    rm -rf /var/clearos/owncloud
    rm -rf /etc/owncloud
    yum clean all
    yum install app-owncloud


    That should do it, I think.

    B.
    The reply is currently minimized Show
  • Accepted Answer

    Friday, August 31 2018, 02:26 AM - #Permalink
    Resolved
    0 votes
    Ok... that's done.

    ls -l /etc/owncloud/config.php
    -rw-r----- 1 apache apache 602 Aug 30 21:24 /etc/owncloud/config.php


    But now I see this:

    /usr/bin/sudo -u apache /opt/rh/rh-php71/root/usr/bin/php /usr/share/owncloud/occ user:add admin
    ownCloud is not installed - only a limited number of commands are available


    There are no commands defined in the "user" namespace.


    And the page still says "The username is already being used"
    The reply is currently minimized Show
  • Accepted Answer

    Friday, August 31 2018, 01:31 AM - #Permalink
    Resolved
    0 votes
    Ya, that file needs to be owned by apache user.

    chown apache /etc/owncloud/config.php


    B.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 30 2018, 10:26 PM - #Permalink
    Resolved
    0 votes
    -rw-r--r-- 1 root root 1382 Aug 29 22:25 /etc/owncloud/config.php
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 30 2018, 08:18 PM - #Permalink
    Resolved
    0 votes
    How about:

     ls -l /etc/owncloud/config.php


    B
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 30 2018, 07:27 PM - #Permalink
    Resolved
    0 votes
    unfortunately, I ran
    chgrp apache /etc/owncloud



    before reading that you just wanted the ls

    So, of course, it now says
    drwxrwxr-x 2 apache apache 4096 Aug 29 22:25 /etc/owncloud




    And the create admin command gives

    Cannot write into "config" directory!
    This can usually be fixed by giving the webserver write access to the config directory

    See https://doc.owncloud.org/server/10.0/go.php?to=admin-dir_permissions
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 30 2018, 06:18 PM - #Permalink
    Resolved
    0 votes
    Actually...can you run:


    ls -ld /etc/owncloud


    First. I was mistakenly thinking of Nextcloud when I was thinking about that permissions issue. I don't know why your folder permissions would be wrong. May be an upgrade issue we missed.

    B.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 30 2018, 06:14 PM - #Permalink
    Resolved
    0 votes
    This was already in - /usr/clearos/apps/owncloud/deploy/uninstall


    OK...I pushed up an update that you must have grabbed.

    Cannot write into "config" directory!
    This can usually be fixed by giving the


    Hmm...that was fixed and nobody should have received that update. Please run:


    chgrp apache /etc/owncloud


    And re-run the admin creation command.

    B.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 30 2018, 06:06 PM - #Permalink
    Resolved
    0 votes
    No luck

    Logged in as root...

    This was already in - /usr/clearos/apps/owncloud/deploy/uninstall

    $MYSQL -uroot -p"$ROOTPASS" -e "DELETE FROM oc_accounts WHERE user_id=\"admin\";" $APP_DB_NAME >/dev/null 2>&1
    logger -p local6.notice -t installer "app-owncloud-core - removing oc_accounts admin"


    I ran
    /usr/clearos/apps/owncloud/deploy/uninstall


    When I ran

    /usr/bin/sudo -u apache /opt/rh/rh-php71/root/usr/bin/php /usr/share/owncloud/occ user:add admin


    I got

    Cannot write into "config" directory!
    This can usually be fixed by giving the webserver write access to the config directory

    See https://doc.owncloud.org/server/10.0/go.php?to=admin-dir_permissions
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 30 2018, 01:31 PM - #Permalink
    Resolved
    0 votes
    It looks like with the upgrade comes a new admin table we didn't know about...I can't find much information on it, however, the following seemst to do the trick.

    Edit:

    /usr/clearos/apps/owncloud/deploy/uninstall and add to the end of the file:


    $MYSQL -uroot -p"$ROOTPASS" -e "DELETE FROM oc_accounts WHERE user_id=\"admin\";" $APP_DB_NAME >/dev/null 2>&1
    logger -p local6.notice -t installer "app-owncloud-core - removing oc_accounts admin"


    Now run that script:


    /usr/clearos/apps/owncloud/deploy/uninstall


    Then create a new admin:


    /usr/bin/sudo -u apache /opt/rh/rh-php71/root/usr/bin/php /usr/share/owncloud/occ user:add admin


    Refresh the page and see if everything checks out OK.

    !!! If you're using owncloud Business for ClearOS, the paths to the uninstall script above change from 'owncloud' to 'owncloud_business'.

    If you could report back here your mileage, then I'll incorporate the fixes into the next update.

    Thanks.

    B
    The reply is currently minimized Show
Your Reply