#might be bit by needing to say `--use-

1 messages ยท Page 1 of 1 (latest)

maiden pebble
#

Hey

glad tapir
#
defaultArgs:
    - couchbase-server
entrypoint:
    - /entrypoint.sh
mounts: []
platform: linux/arm64
user: ""
workdir: ""

from dagger core container from --address couchbase

maiden pebble
#

it finally finished (long socket timeout, like 10 minutes lol)

This is just Zookeeper not working

glad tapir
#

Yeah, there was a change in 0.15 to make ENTRYPOINT not be used by default in AsService to align with WithExec behavior since 0.13 (also some other improvements went in to handling services), but it seems to bite too many people, especially with DBs that all use ENTRYPOINT, so we're considering using the combo of ENTRYPOINT+CMD by default if there are no DefaultArgs or Args on the AsService itself.

maiden pebble
#

oooooooohhh

Yeah, there was a change in 0.15 to make ENTRYPOINT not be used by default in AsService to align with WithExec behavior since 0.13
#

I mean mysql() works? and that'll have its own entrypoint defined in the Dockerfile, to boot it up, and such.. and works just fine? so why is Couchbase being funny?

glad tapir
maiden pebble
#

๐Ÿซก testing

glad tapir
#

๐Ÿ™

#

@worn patio @pallid egret

maiden pebble
#

running it now .. PHP has named arguments btw ๐Ÿ˜‰ so it's basically the same as what you posted ๐Ÿ™‚

#

Still happening - connection refused on port 8093

#

docker run couchbase works just fine

#

and I can telnet to it, just fine, from the "docker run couchbase" so something in Dagger isn't quite right .. ๐Ÿค”

glad tapir
#

dev audio for a sec?

maiden pebble
#

sure thing

#

thanks ๐Ÿ™‚

maiden pebble
#
docker run --rm -p 8093:8093 couchbase
#
tail -f /opt/couchbase/var/lib/couchbase/logs/*.log
#

UPDATE: Jeremy ran the couchbase service up inside "dagger shell" and can replicate the problem .. and is gonna make a ticket for someone to, later, debug it at length to figure out why docker run works but dagger service doesn't.

worn patio
#

@maiden pebble IIUC you can't start the couchbase docker image as a couchbase service?

maiden pebble
#

Right. It can't bind to port 8093, specifically

#

so the couchbase entrypoint isn't working properly, basically, in dagger

worn patio
#

let me check really quick

maiden pebble
#

@worn patio

worn patio
#

are you using couchbase:latest?

maiden pebble
#
docker run --rm -p 8093:8093 couchbase

telnet localhost 8093

try that

#

then kill the container (with docker ps, not CTRL+C, coz couchbase doesn't handle CLI signals :P)

#

In dagger, use this code


    private function couchbase($version = '6.5.1'): Service
    {
        return dag()->container()
            ->from("couchbase")
           ->withExposedPort(8091)
           ->withExposedPort(8092)
           ->withExposedPort(8093)
           ->withExposedPort(8094)
           ->withExposedPort(11210)
            ->asService(useEntrypoint: true);
    }
#

in your favorite language, ofc ๐Ÿ™‚

#

standard code here

->withServiceBinding('couchbase', $this->couchbase())
#

TIP: Jeremy used "dagger shell" to boot the service up, and check out the log files from couchbase ..

#

FYI: inside the couchbase container .. the logs live here

tail -f /opt/couchbase/var/lib/couchbase/logs/*.log

Hope this helps ?

worn patio
#

@maiden pebble 8093 doesn't bind anything for me using docker run

maiden pebble
#

ehh LOL

worn patio
#
age 'couchbase:latest' locally
latest: Pulling from library/couchbase
6414378b6477: Pull complete 
b66e4c8297c0: Pull complete 
9ce06b3288eb: Pull complete 
36ee6a894c26: Pull complete 
de7451ade654: Pull complete 
dac90a5eb80d: Pull complete 
e0e05105422f: Pull complete 
e9b19bb06f3c: Pull complete 
7b714361da71: Pull complete 
785dba9ba6ee: Pull complete 
4f4fb700ef54: Pull complete 
eaf02364dd30: Pull complete 
Digest: sha256:1712f7ea984a17e98422d23cad535a24251fc59726720a535786ea4386dfae77
Status: Downloaded newer image for couchbase:latest
Starting Couchbase Server -- Web UI available at http://<ip>:8091
and logs available in /opt/couchbase/var/lib/couchbase/logs
#
marcos:tmp/lala $ telnet localhost 8093
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
maiden pebble
#

WTF .. works totally fine for me and jeremy

worn patio
#

which would explain why Dagger can't connect

maiden pebble
#

what does your docker run command look like

worn patio
#
 docker run --rm -p 8093:8093 couchbase
Starting Couchbase Server -- Web UI available at http://<ip>:8091
and logs available in /opt/couchbase/var/lib/couchbase/logs
maiden pebble
#

@worn patio pop open another terminal, and docker exec -ti <container_id> bash and then tail those logs

#

what do you see? errors wise ..

worn patio
#

error.log is empty

#

it seems to be that couchbase doesn't bind to 8093 by default

#

at least in the default docker run setup

maiden pebble
#

it does for me and jeremy .. works first time

worn patio
#

are you on a mac?

#

I think it binds in your case "maybe" because some d4m weirdness?

maiden pebble
#

nope, linux .. ubuntu

worn patio
#

ok weird..

#

can you exec in the couchbase container

#

and run netstat -tpnl

#

to see if 8093 is listening?

#

I don't see it here

maiden pebble
worn patio
maiden pebble
#

yep, i understand that yours isn't managing to bind to 8083

worn patio
#

@maiden pebble what do you get with the netstat inside your couchbase container?

#

netstat -tpnl

maiden pebble
worn patio
#

se... 8093 is not being binded

maiden pebble
#

yep

worn patio
#

by the process inside the container

#

I think it's the way on how docker is configured in your machine

#

and how it's proxying the connection to the container

maiden pebble
#

it's the "Query Service"

worn patio
#

yes, but the process is not binding to that port ๐Ÿคทโ€โ™‚๏ธ

maiden pebble
#

I know, I see that

worn patio
#

in any case, for Dagger it doesn't matter

#

because your service client can stil reach that port

#

WithServiceBinding is mostly for healthchecks

#

so if you leave WithServiceBinding 8091 you should be ok

maiden pebble
#

Okay

#

I'm going to consider this a wild goose chase .. and that the original YML with 8093 isn't needed .. and only 8091 is needed.. and just move on

#

WDYT ?

worn patio
#

@glad tapir foundt the root cause of this thread. Not a Dagger error

maiden pebble
worn patio
#

yes, for Dagger that won't matter because the container that you bind the service will still be able to reach 8093 if needed

maiden pebble
#

Fair enough .. makes sense

#

If something, down the line ends up needing 8093 (Query Service) then I'll bring back this conversation, but for now I can just delete the 8093 reference in the code.

maiden pebble
#

@worn patio
this looks like a dagger core msg?

#

looks identical to me ..

worn patio
maiden pebble
#

yea, i just did useEntrypoint, and it worked ๐Ÿ‘

worn patio
#

๐Ÿš€

maiden pebble
#

should I do this eith every asService() then ?

#

postgres, redis, mysql ..etc?

worn patio
#

FWIW we're revisiting this decision as we might change it really soon

maiden pebble
#

I don't think you should make this default behavior, as docker run doesn't work like this .. docker run always defaults to the default defined entrypoint ..

Not great DX

just my opinion

worn patio
#

there's a whole reason for that change that we're still refining some post-release feedback

worn patio
maiden pebble
#

adopting dagger means taking people who know how docker works, and making it accessible via code .. so like-for-like to Docker behavior is important for adoption.

#

so postgres ..

#

this is CLI output - I can see WHY postgres is having problems .. however on the Dagger Cloud it doesn't actually show the error log details

#

I'm assuming you can see that trace, and see that the real Error message isn't being captured by your Tracing thingy? and not visible on Dagger Cloud

FYI โ˜๏ธ

worn patio
#

since you're a Dagger power user, I'd suggest using v3 which has a bunch of these small things improved

maiden pebble
#

How do I get v3? That's just the URL that my dagger CLI outputs on STDOUT

worn patio
maiden pebble
#

I see it

worn patio
#

v3.dagger.cloud

maiden pebble
#

it's on your UI

worn patio
#

yes, but you can't click it from there I think ๐Ÿ˜„

maiden pebble
#

yea, it didn't work, but I found the same trace on the V3 UI

#

THIS IS COOOOOOL

#

v3 for the win

worn patio
#

yep, v3 is :neat:

maiden pebble
#

How do I get my CLI to output the v3 URLs by default? ๐Ÿ˜›

worn patio
#

๐Ÿ”œ

maiden pebble
#

๐Ÿซก

#

environment variable hack would be fine with me ๐Ÿ˜„

DAGGER_CLOUD_VERSION=v3

worn patio
#

lol ๐Ÿ˜„