[Cloud] Tunnel to Trove instance?
Hello, I'm trying to tunnel to my VPS Trove instance, so that I can test some code against the production database. I'm using the following: ssh -N -L 4177:tdlqt33y3nt.svc.trove.eqiad1.wikimedia.cloud:3306 login.toolforge.org I've also tried: ssh -N -L 4177:tdlqt33y3nt.svc.trove.eqiad1.wikimedia.cloud:3306 mwcurator.mwoffliner.eqiad1.wikimedia.cloud The initial connection seems to work, but in my application I'm getting dropped connections. I see the following in the terminal where I set up the tunnel: channel 2: open failed: connect failed: Connection refused channel 2: open failed: connect failed: Connection refused I imagine this isn't a fully supported workflow but I'm wondering if there's some way to get it to work? Thanks, -Travis ___ Cloud mailing list -- cloud@lists.wikimedia.org List information: https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/
[Cloud] Re: Tunnel to Trove instance?
I noticed you say it's a VPS as in Cloud VPS project but you attempt to tunnel via login.toolforge.org. Maybe try tunneling via bastion.wmcloud.org or primary.bastion.wmcloud.org as the bastion hosts for the cloud VPS projects. https://wikitech.wikimedia.org/w/index.php?go=Go&search=bastion.wmcloud.org&title=Special:Search On Fri, Jun 21, 2024 at 9:36 AM Travis Briggs wrote: > Hello, > > I'm trying to tunnel to my VPS Trove instance, so that I can test some > code against the production database. > > I'm using the following: > > ssh -N -L 4177:tdlqt33y3nt.svc.trove.eqiad1.wikimedia.cloud:3306 > login.toolforge.org > > I've also tried: > > ssh -N -L 4177:tdlqt33y3nt.svc.trove.eqiad1.wikimedia.cloud:3306 > mwcurator.mwoffliner.eqiad1.wikimedia.cloud > > The initial connection seems to work, but in my application I'm getting > dropped connections. I see the following in the terminal where I set up the > tunnel: > > channel 2: open failed: connect failed: Connection refused > channel 2: open failed: connect failed: Connection refused > > I imagine this isn't a fully supported workflow but I'm wondering if > there's some way to get it to work? > > Thanks, > -Travis > ___ > Cloud mailing list -- cloud@lists.wikimedia.org > List information: > https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/ > -- Daniel Zahn Site Reliability Engineer ___ Cloud mailing list -- cloud@lists.wikimedia.org List information: https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/
[Cloud] Re: Tunnel to Trove instance?
When I try tunnelling through bastion.wmcloud.org or primary.bastion.wmcloud.org I just get: pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 61] Connection refused)") I can resolve and connect to the trove instance from toolforge, and as I mentioned in my original email, I tried connecting through mwcurator.mwoffliner.eqiad1.wikimedia.cloud which is our VPS box. Thanks, -Travis On Fri, Jun 21, 2024 at 10:21 AM Daniel Zahn wrote: > I noticed you say it's a VPS as in Cloud VPS project but you attempt to > tunnel via login.toolforge.org. > > Maybe try tunneling via bastion.wmcloud.org or primary.bastion.wmcloud.org > > as the bastion hosts for the cloud VPS projects. > > > https://wikitech.wikimedia.org/w/index.php?go=Go&search=bastion.wmcloud.org&title=Special:Search > > On Fri, Jun 21, 2024 at 9:36 AM Travis Briggs wrote: > >> Hello, >> >> I'm trying to tunnel to my VPS Trove instance, so that I can test some >> code against the production database. >> >> I'm using the following: >> >> ssh -N -L 4177:tdlqt33y3nt.svc.trove.eqiad1.wikimedia.cloud:3306 >> login.toolforge.org >> >> I've also tried: >> >> ssh -N -L 4177:tdlqt33y3nt.svc.trove.eqiad1.wikimedia.cloud:3306 >> mwcurator.mwoffliner.eqiad1.wikimedia.cloud >> >> The initial connection seems to work, but in my application I'm getting >> dropped connections. I see the following in the terminal where I set up the >> tunnel: >> >> channel 2: open failed: connect failed: Connection refused >> channel 2: open failed: connect failed: Connection refused >> >> I imagine this isn't a fully supported workflow but I'm wondering if >> there's some way to get it to work? >> >> Thanks, >> -Travis >> ___ >> Cloud mailing list -- cloud@lists.wikimedia.org >> List information: >> https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/ >> > > > -- > Daniel Zahn > Site Reliability Engineer > ___ > Cloud mailing list -- cloud@lists.wikimedia.org > List information: > https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/ > ___ Cloud mailing list -- cloud@lists.wikimedia.org List information: https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/
[Cloud] Re: Tunnel to Trove instance?
I also have just now tried the command line mysql client through the tunnel and things seem to work, so maybe it's some Python setting that's causing the connection to drop? -Travis On Fri, Jun 21, 2024 at 12:06 PM Travis Briggs wrote: > When I try tunnelling through bastion.wmcloud.org or > primary.bastion.wmcloud.org I just get: > > pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on > 'localhost' ([Errno 61] Connection refused)") > > I can resolve and connect to the trove instance from toolforge, and as I > mentioned in my original email, I tried connecting through > mwcurator.mwoffliner.eqiad1.wikimedia.cloud which is our VPS box. > > Thanks, > -Travis > > On Fri, Jun 21, 2024 at 10:21 AM Daniel Zahn wrote: > >> I noticed you say it's a VPS as in Cloud VPS project but you attempt to >> tunnel via login.toolforge.org. >> >> Maybe try tunneling via bastion.wmcloud.org or >> primary.bastion.wmcloud.org >> >> as the bastion hosts for the cloud VPS projects. >> >> >> https://wikitech.wikimedia.org/w/index.php?go=Go&search=bastion.wmcloud.org&title=Special:Search >> >> On Fri, Jun 21, 2024 at 9:36 AM Travis Briggs >> wrote: >> >>> Hello, >>> >>> I'm trying to tunnel to my VPS Trove instance, so that I can test some >>> code against the production database. >>> >>> I'm using the following: >>> >>> ssh -N -L 4177:tdlqt33y3nt.svc.trove.eqiad1.wikimedia.cloud:3306 >>> login.toolforge.org >>> >>> I've also tried: >>> >>> ssh -N -L 4177:tdlqt33y3nt.svc.trove.eqiad1.wikimedia.cloud:3306 >>> mwcurator.mwoffliner.eqiad1.wikimedia.cloud >>> >>> The initial connection seems to work, but in my application I'm getting >>> dropped connections. I see the following in the terminal where I set up the >>> tunnel: >>> >>> channel 2: open failed: connect failed: Connection refused >>> channel 2: open failed: connect failed: Connection refused >>> >>> I imagine this isn't a fully supported workflow but I'm wondering if >>> there's some way to get it to work? >>> >>> Thanks, >>> -Travis >>> ___ >>> Cloud mailing list -- cloud@lists.wikimedia.org >>> List information: >>> https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/ >>> >> >> >> -- >> Daniel Zahn >> Site Reliability Engineer >> ___ >> Cloud mailing list -- cloud@lists.wikimedia.org >> List information: >> https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/ >> > ___ Cloud mailing list -- cloud@lists.wikimedia.org List information: https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/
[Cloud] Re: Tunnel to Trove instance?
There's no fundamental reason why this can't work. I've done similar things: > ssh -t dev.toolforge.org -L 3306:tools.db.svc.wikimedia.cloud:3306" Sometimes it takes a few tries to find the right ssh incantation, but port tunneling is definitely something that works. One thing you might try is running ssh in verbose mode (ssh -v, or -vv, or -vvv to get increasingly more detailed logging). A lot of it is low-level details which may not mean anything, but it's worth a shot to see if anything jumps out at you. Another good debugging tool is netcat (i.e. the "nc" command). You can set to listen for connections on your VPS server (on some arbitrary port) and then try to connect to it. That should at least tell you if you're getting as far as executing a TCP handshake through your tunnel. > On Jun 21, 2024, at 12:35 PM, Travis Briggs wrote: > > I imagine this isn't a fully supported workflow but I'm wondering if there's > some way to get it to work? > ___ Cloud mailing list -- cloud@lists.wikimedia.org List information: https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/
[Cloud] Re: Tunnel to Trove instance?
Yes I've definitely tunnelled successfully to toolforge DBs, and the wiki replica databases, before. I've never had a problem with it, but I suspect the issue is with Trove. Like i said, I can establish the connection and even query my Trove production db from the mysql command line. But it times out/fails in my Python program (which never had a problem before). Thanks, -Travis On Fri, Jun 21, 2024 at 1:55 PM Roy Smith wrote: > There's no fundamental reason why this can't work. I've done similar > things: > > ssh -t dev.toolforge.org -L 3306:tools.db.svc.wikimedia.cloud:3306" > > > > Sometimes it takes a few tries to find the right ssh incantation, but > port tunneling is definitely something that works. One thing you might try > is running ssh in verbose mode (ssh -v, or -vv, or -vvv to get increasingly > more detailed logging). A lot of it is low-level details which may not > mean anything, but it's worth a shot to see if anything jumps out at you. > > > Another good debugging tool is netcat (i.e. the "nc" command). You can > set to listen for connections on your VPS server (on some arbitrary port) > and then try to connect to it. That should at least tell you if you're > getting as far as executing a TCP handshake through your tunnel. > > > > On Jun 21, 2024, at 12:35 PM, Travis Briggs wrote: > > I imagine this isn't a fully supported workflow but I'm wondering if > there's some way to get it to work? > > > ___ > Cloud mailing list -- cloud@lists.wikimedia.org > List information: > https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/ > ___ Cloud mailing list -- cloud@lists.wikimedia.org List information: https://lists.wikimedia.org/postorius/lists/cloud.lists.wikimedia.org/