senx / warp10-docker

Apache License 2.0
20 stars 16 forks source link

Warp10 is not available at 8080 port #114

Closed savelmtr closed 1 year ago

savelmtr commented 1 year ago

Hello everyone! I'm trying to test Warp10. Now I've set it up in docker container. Also I've generated all needed tokens. But when I try to make a request (an http one), I get a connection error. Here is my docker-compose:

version: '3.7'

services:
  warp10:
    image: warp10io/warp10:latest
    restart: always
    volumes:
      - 'warp10_data:/data'
    ports:
      - '8080:8080'
      - '8081:8081'
    environment:
      - WARP10_HEAP=3g
      - WARP10_HEAP_MAX=3g
volumes:
  warp10_data:

Here is my request in pycharm:

POST http://localhost:8080/api/v0/update
Content-Type: text/plain
X-Warp10-Token: 7JFFkgL6wcJT39pOrljslq_.zPasxlye_aVdWA0ufQge4LvJH29yEH7M9PzhmtERxC.I8MQhrEerTJyRVHvIzh3IgR8f1kW63mfoZDiIIL7

1// test{} 42

Here is response in pycharm:

POST http://localhost:8080/api/v0/update

org.apache.http.NoHttpResponseException: localhost:8080 failed to respond

Here is my request in python (for thouse who like python syntax):

r = requests.post(
    'http://host.docker.internal:8080/api/v0/update',
    headers={'Content-Type': 'text/plain', 'X-Warp10-Token': '7JFFkgL6wcJT39pOrljslq_.zPasxlye_aVdWA0ufQge4LvJH29yEH7M9PzhmtERxC.I8MQhrEerTJyRVHvIzh3IgR8f1kW63mfoZDiIIL7'},
    data='''
    1380475081000000// foo{label0=val0,label1=val1} 123
    '''.encode('utf8')
)
r.text

And here is python's traceback (short version):

ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

So, people, what am I doing wrong?

stggn commented 1 year ago

Hi, Does this command work? curl -H "X-Warp10-Token: ${YOUR_WRITE_TOKEN}" http://localhost:8080/api/v0/update --data-binary '// test{} 42'

savelmtr commented 1 year ago

Hi, Does this command work? curl -H "X-Warp10-Token: ${YOUR_WRITE_TOKEN}" http://localhost:8080/api/v0/update --data-binary '// test{} 42'

Hi, no, as you could read in my post, it does not.


curl: (7) Failed to connect to localhost port 8080: Connection refused
stggn commented 1 year ago

Can you try the same command inside the container? Can you provide Warp 10 logs as well?

savelmtr commented 1 year ago

Can you try the same command inside the container? Can you provide Warp 10 logs as well?

Yeah, the previous command was already executed from inside this container. Logs of this container you can read here:


warp10_test> docker-compose logs
warp10_test-warp10-1  | Warp 10 already installed
warp10_test-warp10-1  | Sensision already installed
warp10_test-warp10-1  | 'IN MEMORY' mode is disabled
warp10_test-warp10-1  | Launching Warp 10
warp10_test-warp10-1  | SLF4J: Class path contains multiple SLF4J bindings.
warp10_test-warp10-1  | SLF4J: Found binding in [jar:file:/opt/warp10-2.11.1/bin/warp10-2.11.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
warp10_test-warp10-1  | SLF4J: Found binding in [jar:file:/data/warp10/lib/warp10-ext-hfstore-2.0.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
warp10_test-warp10-1  | SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
warp10_test-warp10-1  | SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
warp10_test-warp10-1  | 2023-01-10T14:44:04,021 main WARN  script.WarpFleetMacroRepository - No validator macro, default macro will reject all URLs.
warp10_test-warp10-1  | Init leveldb
warp10_test-warp10-1  | cat: can't open '/opt/warp10/logs/warp10.pid': No such file or directory
warp10_test-warp10-1  | Warp 10 is running, pid=
warp10_test-warp10-1  | Launching sensision
warp10_test-warp10-1  | Create /var/run/sensision..
warp10_test-warp10-1  | Sensision is running, pid=145
warp10_test-warp10-1  | All process are running
warp10_test-warp10-1  | Warp 10 already installed
warp10_test-warp10-1  | Sensision already installed
warp10_test-warp10-1  | 'IN MEMORY' mode is disabled
warp10_test-warp10-1  | Launching Warp 10
warp10_test-warp10-1  | SLF4J: Class path contains multiple SLF4J bindings.
warp10_test-warp10-1  | SLF4J: Found binding in [jar:file:/opt/warp10-2.11.1/bin/warp10-2.11.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
warp10_test-warp10-1  | SLF4J: Found binding in [jar:file:/data/warp10/lib/warp10-ext-hfstore-2.0.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
warp10_test-warp10-1  | SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
warp10_test-warp10-1  | SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
warp10_test-warp10-1  | 2023-01-13T10:35:58,120 main WARN  script.WarpFleetMacroRepository - No validator macro, default macro will reject all URLs.
warp10_test-warp10-1  | Init leveldb
warp10_test-warp10-1  | cat: can't open '/opt/warp10/logs/warp10.pid': No such file or directory
warp10_test-warp10-1  | Warp 10 is running, pid=
warp10_test-warp10-1  | Launching sensision
warp10_test-warp10-1  | Sensision is running, pid=140
warp10_test-warp10-1  | All process are running
stggn commented 1 year ago

It seems that Warp 10 was not successfully installed on the first run. Try with an empty volume.

savelmtr commented 1 year ago

curl -H "X-Warp10-Token: ${YOUR_WRITE_TOKEN}" http://localhost:8080/api/v0/update --data-binary '// test{} 42'

OK. So I've deleted the volume and started the container from scratch. But instead of success I've got only the same picture:


bash-4.4$ warp10-standalone.sh worf test 31536000000
{"read":{"token":"Aug7YkmLntzYY8MZEQNcgN0.uL_Rxui6TeFJS28X1tgcoPKLyCFuB6znOZtRH9Hgbipn47zMEP_qYAuRW46Srgolk5deCYV2VPNghSPrBmZSxVs7KFR9AF","tokenIdent":"e0f44c3443996714","ttl":31536000000,"application":"test","applications":["test"],"owners":["66faee0d-d368-4667-baf6-dfbeac272b69"],"producer":"66faee0d-d368-4667-baf6-dfbeac272b69","producers":[]},"write":{"token":"AQg3hYEV.ORkgpcSP0wFbvauGn.ooV_2eA5pGzQvO1CCRU6FiuM2uIsUDRXL1GUAJnPOfWgEInugK7b2A8V_Ws1p5eIuJoQ_RMBZh9pwEQ.","tokenIdent":"cf69bf2829a10939","ttl":31536000000,"application":"test","owner":"66faee0d-d368-4667-baf6-dfbeac272b69","producer":"66faee0d-d368-4667-baf6-dfbeac272b69"}}
bash-4.4$ curl -H "X-Warp10-Token: AQg3hYEV.ORkgpcSP0wFbvauGn.ooV_2eA5pGzQvO1CCRU6FiuM2uIsUDRXL1GUAJnPOfWgEInugK7b2A8V_Ws1p5eIuJoQ_RMBZh9pwEQ." http://localhost:8080/api/v0/update --data-binary '// test{} 42'
curl: (7) Failed to connect to localhost port 8080: Connection refused
stggn commented 1 year ago

Weird, I cannot reproduce this behavior with the docker-compose file you gave in the first comment an a docker compose up. In your case, Warp 10 does not start correctly. What does the log says? Do you pass any extra configuration to the container (.env or other)?