senx / warp10-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI Token is still an "Invalid token" warp10:2.3.0-ci

Vincoll opened this issue · comments

I encounter the same problem as the issue #55 which seems, which seems to be resolved by PR #56.

Reproduction:

I'm following this documentation.

  • Run warp10-ci
    docker run -p 8080:8080 --name issueCI_WARP10 warp10io/warp10:2.3.0-ci
Install Warp 10™
Bootstrap..
Fix ownership..
WARP10_HOME: /opt/warp10
Fix permissions..
WARP10_DATA_DIR: /data/warp10
/data/warp10 does not exist - Creating it...
########[ Initialized with 1000 time units per millisecond ]########
log4j:WARN No appenders could be found for logger (io.warp10.script.WarpFleetMacroRepository).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
REPORT secret not set, using '74ba72cf-1937-4599-ad47-afc5873eeb5e'.
Warp 10 config has been generated here: /opt/warp10/etc/conf.d
Install Sensision
Bootstrap Sensision..
Fix ownership..
SENSISION_HOME: /opt/sensision
Fix permissions..
SENSISION_DATA_DIR: /data/sensision
/data/sensision does not exist - Creating it...
Sensision: generate configuration with Warp10 conf/jar..
WARP10_CONFIG_DIR: /opt/warp10/etc/conf.d
WARP10_EXT_CONFIG_DIR: 
WARP10_JAR: /opt/warp10/bin/warp10-2.3.0.jar
log4j:WARN No appenders could be found for logger (io.warp10.script.WarpFleetMacroRepository).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
########[ Initialized with 1000 time units per millisecond ]########
log4j:WARN No appenders could be found for logger (io.warp10.script.WarpFleetMacroRepository).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
REPORT secret not set, using '743ae64a-99ab-42a2-9575-15af7a3ee180'.
'IN MEMORY' mode is disabled
Launch Warp 10™
Init leveldb
  ___       __                           ____________   
  __ |     / /_____ _______________      __<  /_  __ \  
  __ | /| / /_  __ `/_  ___/__  __ \     __  /_  / / /  
  __ |/ |/ / / /_/ /_  /   __  /_/ /     _  / / /_/ /   
  ____/|__/  \__,_/ /_/    _  .___/      /_/  \____/    
                           /_/                          
##
## Warp 10 listens on 0.0.0.0:8080
##
##
## An initial set of tokens was generated for you so you can immediately use Warp 10:
##
## Write Token: NYXykNamTo3zQKNEiYxoSSdpHt95cYnjIDyTprrzA7Ii5yf4GqjU6cktyqBhae2.pXW00pHtQEVOT51ed.AEVZsSPmjxuIfBTjrBvDYWJSxfRNwSl2W_tuPYK4zqw9At
## Read Token: V3l0J8Rl_pJwYx1KUwtiOQDgxc5JOjfmndIXK_xuNcVtjQI7dHShpQKzKFBfSWeLDQHQ_bD0yf7VUdImciyIidtHxJFb15wMZ6cpoG1YDNNEr7gPJ7pjtym51Hu9P2..CQIemxmM79pZnqxt6TSLrvdJIeUsBoQedHTXaz6S1wCtVL8WkgVEc.
##
## Push some test data using:
##
##   curl -H 'X-Warp10-Token: NYXykNamTo3zQKNEiYxoSSdpHt95cYnjIDyTprrzA7Ii5yf4GqjU6cktyqBhae2.pXW00pHtQEVOT51ed.AEVZsSPmjxuIfBTjrBvDYWJSxfRNwSl2W_tuPYK4zqw9At' http://0.0.0.0:8080/api/v0/update --data-binary '// test{} 42'
##
## And read it back using:
##
##   curl 'http://0.0.0.0:8080/api/v0/fetch?token=V3l0J8Rl_pJwYx1KUwtiOQDgxc5JOjfmndIXK_xuNcVtjQI7dHShpQKzKFBfSWeLDQHQ_bD0yf7VUdImciyIidtHxJFb15wMZ6cpoG1YDNNEr7gPJ7pjtym51Hu9P2..CQIemxmM79pZnqxt6TSLrvdJIeUsBoQedHTXaz6S1wCtVL8WkgVEc.&selector=~.*\{\}&now=now&timespan=-1'
##
## You can submit WarpScript for execution via:
##
##   curl http://0.0.0.0:8080/api/v0/exec --data-binary @path/to/WarpScriptFile
##
Warp10 running, pid=756
Create /var/run/sensision..
Sensision running, pid=881
All process are running
  • Getting the CI tokens
    docker exec -t issueCI_WARP10 cat /data/warp10/etc/ci.tokens
token.write.0.name=writeTokenCI
token.write.0.producer=42424242-4242-4242-4242-424242424242
token.write.0.owner=42424242-4242-4242-4242-424242424242
token.write.0.app=testCI


token.read.0.name=readTokenCI
token.read.0.owner=42424242-4242-4242-4242-424242424242
token.read.0.app=testCI
  • If I try to insert with initial set of tokens 🆗
    curl -H 'X-Warp10-Token: 6jd7ghMABoMznf80Ovf54MZFLJ6AhE.5I5U2r7DbzodDd4aO6S50.NMTldq8L1GCHof0jBpzhZCPflJBTOqXhZW.3Li3uQ6cN8if6L3vaV_P7sExQeMqMh_FFKIInEtY' http://0.0.0.0:8080/api/v0/update --data-binary '// test{} 42'
    HTTP 200

  • But if I try to insert with ci tokens ❌
    curl -v -H 'X-Warp10-Token: 42424242-4242-4242-4242-424242424242' --data-binary "1// test{} 42" 'http://127.0.0.1:8080/api/v0/update'

<title>Error 500 Error when updating data: io.warp10.script.WarpScriptException: Invalid token. (Invalid token.)</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /api/v0/update. Reason:
<pre>    Error when updating data: io.warp10.script.WarpScriptException: Invalid token. (Invalid token.)</pre></p>
</body>

If I understand the documentation correctly 4242 CI tokens should allow me to write/read data.
Or do I do something wrong?

Hi,

"42424242-4242-4242-4242-424242424242" is a UUID for the producer and the owner of data.
CI tokens are "readTokenCI" and "writeTokenCI":
curl -v -H 'X-Warp10-Token: writeTokenCI' --data-binary "1// test{} 42" 'http://127.0.0.1:8080/api/v0/update'
and: [ 'readTokenCI' '~.*' {} NOW -1 ] FETCH

You can verify tokens with this WarpScript:

"42424242-4242-4242-4242-424242424242" TOKENINFO
"readTokenCI" TOKENINFO

I will update the documentation to be clearer.
Best regards.