rackerbenoit / chef-flywaydb

Chef cookbook to install flywaydb and execute flyway commands
http://flywaydb.org/
MIT License
3 stars 3 forks source link

cookbook 5.0.1 account already exists #11

Closed albeekj closed 8 years ago

albeekj commented 8 years ago

After installing the new version on windows 2012r2, I am now getting a new error.

group[flyway2](C:/chef/cache/cookbooks/flywaydb/providers/default.rb line 21) had an error: ArgumentError: The account already exists. ---- Begin Win32 API output ---- System Error Code: 2224 System Error Message: The account already exists.

It is now erroring out due to that

dhoer commented 8 years ago

Can you please show me how you are creating the user and calling flywaydb?

albeekj commented 8 years ago

In default cookbook => default.rb

only for testing

nothing in attributes/default.rb, left as default

include_recipe 'flywaydb' [...] flywaydb 'myapp' do flyway_conf( url: 'jdbc:jtds:sqlserver://10.4.9.151:1433/flyway_tst', user: 'sa', password: 'redacted', locations: 'filesystem:d:\db\migrations' ) action :migrate end

dhoer commented 8 years ago

Try leaving the password off and don't include the recipe. Migrate will install the flywaydb for you if it is not already installed. So what I think is happening is that the flywaydb recipe is installing user without a password defined, then it tries to recreate it with a blank password.

albeekj commented 8 years ago

​I will try your suggestion, however in version 5.0.0, flywaydb was working fine aside from having to move files from flyway-4.0 up one directory​ to the expected installdir/flyway. I will let you know what happens with your suggestion.

On Wed, Apr 20, 2016 at 12:51 PM, Dennis Hoer notifications@github.com wrote:

Try leaving the password off and don't include the recipe. Migrate will install the flywaydb for you if it is not already installed. So what I think is happening is that the flywaydb recipe is installing user without a password defined, then it tries to recreate it with a blank password.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/dhoer/chef-flywaydb/issues/11#issuecomment-212556610

Thank you,

Kaleb Albee

dhoer commented 8 years ago

Leaving the password as nil might work with no other changes.

dhoer commented 8 years ago

It seems windows 2012r2 requires a password. I take you are running windows 10?

dhoer commented 8 years ago

If you want to set a password and want to keep the install separate, then you will have to replace the recipe with a resource call like shown in here: https://github.com/dhoer/chef-flywaydb/blob/master/test/fixtures/cookbooks/flywaydb_test/recipes/_flywaydb_install.rb

albeekj commented 8 years ago

I am running on ubuntu and the box issuing the flywaydb command is the 2012r2 box same as the db, but the box fails at install

dhoer commented 8 years ago

Humm, I wonder why my 2012r2 server requires a password when creating flyway user?

Also note that the example is using attributes to pass password, which is a no-no. The password, if required, should come from data bag or some other secure way.

Check out .kitchen.yml for examples caling both linux and windows.

dhoer commented 8 years ago

I re-wrote the readme to not mention default recipe, since all actions will install if flywaydb is not already installed, and to be more clear when to use the password. I would really appreciate some feedback on these changes to make sure it is more clear on how to use this cookbook.

albeekj commented 8 years ago

No problem, I will let you know later tonight.

On Wed, Apr 20, 2016 at 1:59 PM, Dennis Hoer notifications@github.com wrote:

I re-wrote the readme to not mention default recipe, since all actions will install if flywaydb is not already installed, and to be more clear when to use the password. I would really appreciate some feedback on these changes to make sure it is more clear on how to use this cookbook.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/dhoer/chef-flywaydb/issues/11#issuecomment-212580362

Thank you,

Kaleb Albee

dhoer commented 8 years ago

Did this issue get resolved?

dhoer commented 8 years ago

I'm closing this issue because I haven't heard back from you. Please open another issue if that is not the case.