[Labs-l] MySQL server error

Emilio J. Rodríguez-Posada emijrp at gmail.com
Wed May 14 20:45:19 UTC 2014


Thanks for reporting the bug.

I wrote "python wmcounter.py" in my crontab. What should I write?


2014-05-14 22:36 GMT+02:00 Tim Landscheidt <tim at tim-landscheidt.de>:

> Emilio J. Rodríguez-Posada <emijrp at gmail.com> wrote in a
> different order:
>
> >> > I coded a script that uses several wiki databases and servers. When I
> >> > manually execute it, it works fine, but after adding it to cron, it
> >> returns
> >> > this error:
> >> [...]
> >> > _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host
> >> > 's3.labsdb' (0)")
>
> >> Sounds like whatever host you end up running on is missing /etc/hosts
> >> entries.
>
> >> See
> >>
> https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/Help#Connecting_to_the_database_replicas_from_other_Labs_instances
>
> > Why things are so difficult? :-/
>
> That's what you would need from another Labs project.  In
> Tools, you should be able to connect to s3.labsdb from all
> hosts.
>
> And indeed, all exec nodes have s3.labsdb in their
> /etc/hosts:
>
> | scfc at tools-login:~$ for HOST in tools-exec-{01..10}; do ssh $HOST
> 'fgrep -q s3.labsdb /etc/hosts || hostname'; done
> | scfc at tools-login:~$
>
> But all aliases are missing on tools-submit:
>
> | scfc at tools-login:~$ ssh tools-submit cat /etc/hosts
> | 127.0.0.1 localhost
> | 127.0.1.1 ubuntu.pmtpa.wmflabs ubuntu
>
> | # The following lines are desirable for IPv6 capable hosts
> | ::1 ip6-localhost ip6-loopback
> | fe00::0 ip6-localnet
> | ff00::0 ip6-mcastprefix
> | ff02::1 ip6-allnodes
> | ff02::2 ip6-allrouters
> | ff02::3 ip6-allhosts
> | scfc at tools-login:~$
>
> which leads me to the conclusion that you aren't submitting
> your cron job to the grid with jsub/qsub, but executing it
> on tools-submit itself (which is allowed under certain con-
> ditions).  I filed https://bugzilla.wikimedia.org/65308 for
> the missing aliases/NAT on tools-submit.
>
> Unfortunately, I don't have sudo rights on tools-submit, so
> I can't fix it right away.  So you could either wait for
> Coren to return from his holiday on Friday, or change your
> cron job so that it is submitted to the grid instead.
>
> Tim
>
>
> _______________________________________________
> Labs-l mailing list
> Labs-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/labs-l
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/labs-l/attachments/20140514/6352073b/attachment.html>


More information about the Labs-l mailing list