Page MenuHomePhabricator

Missing replicy.my.conf on Tools Labs
Closed, ResolvedPublic

Description

I have just gained access to Tool Labs and I do not have a replica.my.conf in my home directory. As of WikiTech I have to create a ticket in Phabricator.

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald Transcript
Fabian24d97 claimed this task.

@Fabian24d97: I noticed that you marked this as resolved by yourself. How did you fix this issue? Other users have been experiencing it too, so it'd be useful to know... Semi-relevant XKCD: https://xkcd.com/979/

@Krenair
I have missed that only tools have a replica.my.conf, so I created a tool which then had one.

scfc removed Fabian24d97 as the assignee of this task.
scfc subscribed.

That's not true: All user and tool accounts (in the Toolforge project) should have a ~/replica.my.cnf (cf. https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/Database and modules/labstore/files/create-dbusers).

I tested modules/labstore/files/create-dbusers's logic to find all users and servicegroups (print(all_users)), and a) it does not seem to include the user account fdamken or Fabian24d97 and b) the logic for calculating the home directory looks wrong:

def homedir(self):
    prefix = '/srv/project/%s' % self.project
    if self.kind == 'user':
        return os.path.join(prefix, 'home', self.name.lower())
    else:
        return os.path.join(
            prefix, 'project',
            re.sub(r'^%s\.' % self.project, '', self.name.lower())
        )

For tool accounts, self.name is for example tools.wikilint, but for user accounts, self.name is for example Tim Landscheidt, so the logic will only work for user accounts with the same shell user name as the wiki user name.

scfc claimed this task.

You now have a working replica.my.cnf in your home directory.