You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the script atlas_security.sh should be modified to wait for webapi to be ready before it tries to check that the users can successfully log in to the WebAPI.
The fix that worked for me is the following:
until curl -fsSI "$WEBAPI_URL/user/login/db"> /dev/null;doprintf'\nsleep for 5s.\n'
sleep 5
done
the above lines need to be added to the above mentioned script at line 15 so the overall script will look like:
#!/bin/bashset -o errexit
set -o pipefail
set -o nounset
LOG_FILE=/mnt/azscripts/azscriptoutput/all.log
exec>>(tee -ia ${LOG_FILE})exec2>>(tee -ia ${LOG_FILE}>&2)
apk --update add postgresql-client apache2-utils
psql -v ON_ERROR_STOP=1 -e "$OHDSI_ADMIN_CONNECTION_STRING" -c "$SQL_ATLAS_CREATE_SECURITY"until curl -fsSI "$WEBAPI_URL/user/login/db"> /dev/null;doprintf'\nsleep for 5s.\n'
sleep 5
done
count=1
foriin${ATLAS_USERS//,/ }doif [ "$(("$count" %2))"-eq"1" ];then
username=$ielse# shellcheck disable=SC2016
atlaspw=$(htpasswd -bnBC 4 """$i"| tr -d ':\n'| sed 's/$2y/$2a/')
psql -v ON_ERROR_STOP=1 -e "$OHDSI_ADMIN_CONNECTION_STRING" -c "insert into webapi_security.security (email,password) values ('$username', E'$atlaspw');"# this step adds some required rows/ids in the db
curl "$WEBAPI_URL/user/login/db" --data-urlencode "login=$username" --data-urlencode "password=$i" --fail
if [ "$count"="2" ];then
psql -v ON_ERROR_STOP=1 -e "$OHDSI_ADMIN_CONNECTION_STRING" -c "insert into webapi.sec_user_role (user_id, role_id) values ((select id from webapi.sec_user where login='$username'),2);"#admin roleelse
psql -v ON_ERROR_STOP=1 -e "$OHDSI_ADMIN_CONNECTION_STRING" -c "insert into webapi.sec_user_role (user_id, role_id) values ((select id from webapi.sec_user where login='$username'),10);"#atlas user rolefifi((count++))done
The text was updated successfully, but these errors were encountered:
the script
atlas_security.sh
should be modified to wait for webapi to be ready before it tries to check that the users can successfully log in to the WebAPI.The fix that worked for me is the following:
the above lines need to be added to the above mentioned script at line 15 so the overall script will look like:
The text was updated successfully, but these errors were encountered: