I’m embarrassed to ask this, but here we go.
I’m trying to get through the Snowplow Mini Quickstart and I’m stuck in 2.3 Testing.
Open up Elasticsearch and check the returned JSON:
curl --user username:password http://< the public ip>/elasticsearch You should see a 200 OK response
I am getting a 401 response from this.
I’ve tried stopping my instance and changing the username and password in the “View/Change User Data” dialog. I’ve tried this from the command line. I’ve also tried this using Postman with to send a GET with basic authentication. Both give me the same response.
To test this I have just spun up a fresh Snowplow Mini instance - however I cannot seem to replicate the issue you are seeing! The only time I seem to be able to get a 401 response is if I do not supply the --user | -u option or if the basic auth values are not set correctly.
If you could please supply:
The AWS Region that you are experiencing the issue within?
The AMI ID you are using?
Does the username and password work as expected if you attempt to navigate to the home page?
Hi @StewSchiling - just to confirm that you are also pasting the other section of the User Data script in as well?
# DO NOT ALTER BELOW #
#add apiKey to iglu-resolver.json for auth in the iglu server
iglu_resolver_config_dir="/home/ubuntu/snowplow/configs/iglu-resolver.json"
sed -i 's/\(.*"apikey":\)\(.*\)/\1 "'$iglu_server_super_uid'"/' $iglu_resolver_config_dir
#write super apikey to db
export PGPASSWORD=snowplow
iglu_server_setup="INSERT INTO apikeys (uid, vendor_prefix, permission, createdat) VALUES ('${iglu_server_super_uid}','*','super',current_timestamp);"
psql --host=localhost --port=5432 --username=snowplow --dbname=iglu -c "${iglu_server_setup}"
#add domain name to Caddyfile
inserted_line=""
sed -i '1d' /home/ubuntu/snowplow/configs/Caddyfile #delete first line of the default Caddyfile
if [[ "${tls_cond}" == "on" ]]; then
inserted_line="$domain_name *:80 { \n tls example@example.com \n"
else
inserted_line="*:80 { \n tls off \n"
fi
sed -i "1s/^/${inserted_line}/" /home/ubuntu/snowplow/configs/Caddyfile
#add username and password to Caddyfile for basic auth
sed -i "s/USERNAME_PLACEHOLDER/$username/g" /home/ubuntu/snowplow/configs/Caddyfile
sed -i "s/PASSWORD_PLACEHOLDER/$password/g" /home/ubuntu/snowplow/configs/Caddyfile
sudo service caddy_init restart
As this is the code that will actually setup your username and password.
I ended up wiping the slate clean and walking through the quickstart steps with a new instance. I’m now getting the expected 200 OK from /elasticsearch
I’m not sure where I went wrong, but I think I’m OK with not knowing for now.
I’ve managed to fumble my way partly through the quickstart but I’m really struggling with the learning curve. I’m going to start a new post on the more general topic of how and where to start.