I am a little desperate and confused. We have been using the Knime server for a few months and so far it is running quite stable. During installation we created multiple users like knimeadmin and so far we have been able to log in via the webportal without any problems.
This morning we suddenly could not put any workflows on the server via the client. Therefore, we have restarted via
the server via:
bash /opt/knime/4.15.2.0130/apache-tomcat-9.0.58/bin/shutdown.sh
and bash /opt/knime/4.15.2.0130/apache-tomcat-9.0.58/bin/startup.sh
However, we can now no longer log in via the webportal with the knimeadmin account: “Login failed. Please try again”. Also no user can connect to the server via the client: “User abc cannot be authenticated, probably the password is wrong”. However we are sure that the knimeadmin as well as all user-level passwords are correct and we did not change them.
So, while I still don’t know how this happened, i found a solution.
I was able to connect to the H2 database and saw that indeed no user was inside the users table.
With the following script I managed to create a user manually via cli:
#!/bin/bash
set -x
# Location of this script.
location="/opt/knime"
# tomcat home directory
tomcat_home="/opt/knime/4.15.2.0130/apache-tomcat-9.0.58"
# db parameters
dburl="jdbc:h2:$tomcat_home/conf/userconf"
# construct db query
read -p 'Username: ' user
read -p 'Password: ' pw
newpassword=$pw
newpassword=$($tomcat_home/bin/digest.sh -a sha-256 $newpassword)
newpassword=${newpassword#*:}
echo "insert into users values('$user', '$newpassword');" > $location/dbscript
chown knime:knime $location/dbscript
# manipulate db
java -cp $tomcat_home/lib/h2*.jar org.h2.tools.RunScript -url $dburl -script $location/dbscript
# delete script file
rm dbscript
exit 0
Good to hear that you already found the solution, thanks for sharing it here.
I expect that your H2 user database, the userconf.mv.db got corrupted somehow. I have never heard about such a case so I don’t know what could have caused this.