Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gbak issues "Your user name and password are not defined" when command switch "-fe(tch_password) ..." is specified when run as service [CORE6000] #6250

Closed
firebird-automations opened this issue Feb 16, 2019 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Create following batch for test (replace value of 'fbc' with folder where FB-binaries are; replace value 'dbnm' with apropriate for your env.):

@echo off
setlocal enabledelayedexpansion enableextensions
::set fbc=C:\\FB\\40SS
::set fbc=C:\\FB\\30SS
set fbc=C:\\FB\\25sC\\bin

set ISC\_USER=
set ISC\_PASSWORD=
set sql=%\~dpn0\.sql
set pwf=%\~dpn0\.tmp
set psw=masterkey
echo \!psw\! \>\!pwf\!

set dbnm=C:\\FBTESTING\\qa\\misc\\tmptest\.fdb
for /f %%a in \("\!dbnm\!"\) do \(
   set dbbk=%%\~dpna\.fbk
\)
del \!dbnm\! 2\>nul
del \!dbbk\! 2\>nul

echo create database 'localhost:\!dbnm\!' user 'SYSDBA' password '\!psw\!'; \> \!sql\!

\!fbc\!\\isql \-q \-i \!sql\!
\!fbc\!\\gfix \-shut full \-force 0 localhost:\!dbnm\! \-user sysdba \-pas \!psw\!

@echo on

\!fbc\!\\gbak \-b localhost:\!dbnm\! \!dbbk\! \-user sysdba \-pas \!psw\!

\!fbc\!\\gbak \-b \-se service\_mgr \!dbnm\! \!dbbk\! \-user sysdba \-pas \!psw\!

\!fbc\!\\gbak \-b localhost:\!dbnm\! \!dbbk\! \-user sysdba \-fe \!pwf\!

\!fbc\!\\fbsvcmgr service\_mgr user sysdba fetch\_password \!pwf\! action\_backup dbname \!dbnm\! bkp\_file \!dbbk\!

\!fbc\!\\gbak \-b \-se service\_mgr \!dbnm\! \!dbbk\! \-user sysdba \-fe \!pwf\!


@echo off
del \!dbbk\! 2\>nul
del \!dbnm\!
del \!sql\!
del \!pwf\!

=====

If we run this batch then its output will be:

C:\\FBTESTING\\qa\\misc\>\!fbc\!\\gbak \-b localhost:\!dbnm\! \!dbbk\! \-user sysdba \-pas \!psw\!
gbak: ERROR:database C:\\FBTESTING\\QA\\MISC\\TMPTEST\.FDB shutdown \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- OK, expected
gbak:Exiting before completion due to errors

C:\\FBTESTING\\qa\\misc\>\!fbc\!\\gbak \-b \-se service\_mgr \!dbnm\! \!dbbk\! \-user sysdba \-pas \!psw\!
gbak: ERROR:database C:\\FBTESTING\\QA\\MISC\\TMPTEST\.FDB shutdown \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- OK, expected
gbak: ERROR:    Exiting before completion due to errors
gbak:Exiting before completion due to errors

C:\\FBTESTING\\qa\\misc\>\!fbc\!\\gbak \-b localhost:\!dbnm\! \!dbbk\! \-user sysdba \-fe \!pwf\!
gbak: ERROR:database C:\\FBTESTING\\QA\\MISC\\TMPTEST\.FDB shutdown \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- OK, expected
gbak:Exiting before completion due to errors

C:\\FBTESTING\\qa\\misc\>\!fbc\!\\fbsvcmgr service\_mgr user sysdba fetch\_password \!pwf\! action\_backup dbname \!dbnm\! bkp\_file \!dbbk\!
database C:\\FBTESTING\\QA\\MISC\\TMPTEST\.FDB shutdown \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- OK, expected
\-Exiting before completion due to errors

C:\\FBTESTING\\qa\\misc\>\!fbc\!\\gbak \-b \-se service\_mgr \!dbnm\! \!dbbk\! \-user sysdba \-fe \!pwf\!
gbak: ERROR:Your user name and password are not defined\. Ask your database administrator to set up a Firebird login\. \-\-\-\-\-\-\-\-\-\- \[ ??? \]
gbak:Exiting before completion due to errors

=====

PS.

Only FB 2.5.x is affected. No such problem on 3.x and 4.x

Commits: 66742f8 69ba7fc

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

summary: gbak issues "Your user name and password are not defined" instead of "database shutdown" when command switch "-fe(tch_password) ..." is specified with correct password in file => gbak issues "Your user name and password are not defined" when command switch "-fe(tch_password) ..." is specified when run as service

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0.5 [ 10885 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

I do not understand why did you not reproduce it on FB >= 3 - may be due to writing too many batch files? ;)
Without a fix bug is easily and 100% reproduced on default FB using single line:
gbak -se localhost: -b employee some-file.fbk -user sysdba -fet xf.txt
where xf.txt contains "masterkey".

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> I do not understand why did you not reproduce it on FB >= 3
Can't remember :-)

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants