Closed armorKing11 closed 2 years ago
However, there's no reason to think it didnt create the database. It's just that it doesn't log anything when it does. Remember that the schema for the database comes from the dumpfile and not the CREATE_DB
step.
I understand that the table doesn't exist at anonymization-time, though. If i was looking into this, I'd start by making absolutely sure that the table in question is in the dumpfile/sql and that the strategyfile is referencing it correctly, including any options like schema, etc.
To be clear, have you tried restoring this dumpfile manually, and does that work (i.e is the table present there?).
The pynonymizer works correctly if you use the only_step
parameter in the run() call for all the steps specified individually which is my current workaround ,ie,
1. CREATE_DB
2. RESTORE_DB
3. ANONYMIZE_DB
4. DUMP_DB
What is does not appear to do is go through its default process control as you specified in the readme and code as i mentioned in my above comments. I will look into enabling a logger to access the pynonymizer logs at a hopefully higher verbosity level to investigate the issue more over the weekend Thanks for the quick response @rwnx
At the moment, to go further on this I think we need to put together a replication case we can test against.
The information provided here would indicate something seriously wrong with the normal flow of the tool, which we definitely don't want, but likewise, doesn't seem to happen in any of our tests.
Can you give any more info about your use case?
How big is the dumpfile you're restoring? ( My thinking is it might be related to the fix in #98 ). If you try against the current master, that could be useful. alternatively, wait for this change to ship in the next release !
The dump file i am restoring is only about 50 MB and i was using the code in master , but looking at the version ( i am using 1.21.3) , i assume the #98 fix is available in 1.22.0 ? The release history at https://pypi.org/project/pynonymizer/1.22.0/#history does not tell me what fixes are included in that release . Can you please confirm if the fix is present in 1.22.0 release , @rwnx ?
Hi, yes, that's present in v1.22.0.
If you want to know what's in each release, you can check out the CHANGELOG or compare git tags.
Thanks @rwnx !!
I'm assuming this was fixed for you, so am closing this issue. Let me know if that's not the case.
Describe the bug When i run pynonymizer to use its process control system , it fails to go through the default process control flow ,ie, as per
pynonymize.py
, it is supposed to go through the below flow starting withCREATE_DB
is per my understandingBut in reality when i run it as follows , it does not create the db and fails
To Reproduce Issue1:
Does this imply that it did not run
CREATE_DB
by default, but instead ranRESTORE_DB
first , since logs state restoring followed by the logs stating Table 'main_sys.admins' does not exist ? So i tried to explicitly start fromCREATE_DB
step as shown in Issue2 below Error log:Issue2:
When i tried to use
start_at_step='CREATE_DB'
inpynonymizer.run()
to understand and change the process control behaviour by ensuring that the database gets created to prevent the above error , the following below error happens which implies that the it is attempting to runRESTORE_DB
and thanCREATE_DB
causing the below failure even though it is supposed to firstCREATE_DB
. Error log:Can you please advise how i can i achieve the basic process flow via the python script ,ie,
. Thank you @rwnx The only way i am able to use the tool in a step by step manner is to specify the
only_step
by calling pynonymizer.run for each of the below valuesCREATE_DB, RESTORE_DB,ANONYMIZE_DB,DUMP_DB
Expected behavior As per documentation and code it should go through the steps in the below order as default process control behaviour ,ie,
Additional context