Closed gntpet closed 2 years ago
My guestimate is that docker "dockerstart" does not recreate BC user when using in combination with sqlbackup. it restores the database, sees that user with such a name already exists, and does not update the password for it. Could you check this theory on your side, guys?
That might very well be the case.
Question - why not use the same password? 🤔
Because I'm not in control of the password management code. ALOPS does that for me. There's no option for me to pass user/password to ALOpsDockerStart
No, what I mean is, just provide the same password as in the database for running tests?
I do. the problem is that backup contains password from the previous run.
- task: ALOpsAppTest@1
inputs:
usedocker: true
testfilter: '50000..99999'
import_testtoolkit: false
failed_test_action: 'Error'
testpage: 90409
companyname: AutoTest
show_available_tests: true
timeoutInMinutes: 30
bc_username: $(ALOPS_DOCKER_ADMINUSER)
bc_password: $(ALOPS_DOCKER_ADMINPASSWORD)
bc_authentication: NavUserPassword
nav_serverinstance: $(ALOPS_DOCKER_NAVSERVERINSTANCE)
Hm, so you don't have the password, correct?
let's see example
Run1
Run2
Hope the picture is clearer now
hm, so you want us to make an option to reset the user 🤔. That's harder than you think - we can't just always do that.
Do know you can script your way into the db with ALOpsDockerExec ... 🤔
well, I think ALOpsDockerStart just creates BC user using BC shell commands "new-navserveruser". So you just need to check if user already exists, and if yes change his password using "Set-navserveruser" command.
p.s. i am guessing here, since I didn't see your sourcecode.
in my opinion it should be fixed within standard ALOPS, since I am just using pure ALOPS commands. I am not using custom dbs, just the ones that ALOPS created and made backup of it.
one more thing, it seems that you already do some magic with the BC Credentials in ALOpsAppTest step
We checked.
We don't create users - this is default "NAVDocker" scripts that are executed in the BC Containers.
So, ALOps is not doing any magic in terms of "users" on top of how default NAV Docker stuff works. Re-using an existing database kind of requires you to know the password. So if you use a database that is created by the NAVDocker scripts from MS, then you'll have to find a way to remember the password.
Suggestion - Remove the users from the database before the backup. This should help you in that: https://www.waldo.be/2012/12/05/nav-2013-how-to-log-in-any-database/
You could also just build a database that you can re-use all the time, that you manage yourself, and then use that in all pipelines, with a managed user.
You have feedback according to my suggestions?
Will close issue since there hasn't been any feedback. Please re-open if it's still an issue ..
Hey @waldo1001,
We are experiencing strange issue with authentification while running automated tests (InvalidCredentialsError). Any clue why it is happening?
Here's the steps we use to create image, start container, and run tests:
here are the logs we get when starting container:
here are the logs we get when running tests: