first-time setup with database does not work
ramonskie opened this issue · 13 comments
i have 2 problems the first is
in this line of code
https://github.com/bflad/chef-stash/blob/master/templates/default/stash-config.properties.erb#L11
with
<%= @database['host'] == "localhost" ? node['mysql']['bind_address'] : @database['host'] %>
because this will use my mysql bind_address and this is 0.0.0.0
so anyone can connect.
and a application can't connect to a address called mysql://0.0.0.0
so i replaced this with localhost for now
maby i do something wrong i don't know.
and i also have the problem whith a first time setup and the stash-config.properties
is filled than the setup does not continue it will fail with crowddoa error.
anyone else experienced the same issues?
So as I understand it, you're running the MySQL database locally on the Stash server, but would like to expose it on all interfaces. What happens if you set the Stash database host to 127.0.0.1 in your configuration? I believe this would get around this issue. I should probably adjust the logic to handle this case instead of documenting and requiring a manual change. I'll see what I can do.
I haven't personally seen the crowddoa error yet on any platform. Are you able to provide more information about your setup or maybe the Stash logs in a Gist? Thanks a bunch.
Of course if you set to 127.0.0.1, it loses all the automatic installation magic based on "localhost" conditions. It'll only work with 127.0.0.1 if the database is already setup. Needs a real fix.
Your first issue should be resolved with cookbook version 3.1.1. Was able to successfully test localhost MySQL setup without setting bind_address (defaults to NIC IP address) and with setting bind_address to 0.0.0.0.
# With: node['mysql']['bind_address'] = '0.0.0.0'
# able to browse to Stash UI
# able to log into MySQL server remotely:
chef-stash (master *=)$ mysql -ustash -pchangeit -h 192.168.50.11
...
mysql>
Please let me know about your second issue. Cheers.
hi sorry for the late reply i was in hong-kong for the openstack summit.
i will check and test this ou
well it seems now that it does something to the database but i ran in to this error
https://confluence.atlassian.com/display/STASHKB/Stash+Does+Not+Start+-+Could+not+acquire+change+log+lock
I've seen this occasionally since I initially wrote the cookbook when spinning up VMs with Vagrant, which would imitate initial server setup. If I had to venture a guess, it's badly timed delayed MySQL restart at the end of the Chef run when Stash is initializing the database on first startup. Could probably optimize around this behavior
yes i have this problem with vagrant also
is this maby a chef-solo issue?
i can try to use vagrant and chef-zero
Could also be a badly timed Stash restart while it's got the database lock. I'm tired of ignoring the problem and can dig into it deeper tonight. :)
if i have some time left i will also check this out
i use chef-zero now but the same thing occurs :(
i think the best option is to start stash at the very end
so remove the start from the following line should solve it because when after that the the templates should restart stash with delayed option
https://github.com/bflad/chef-stash/blob/master/recipes/service_init.rb#L9
i just tested this.
and it works like a charm 👍
I've made both of these changes recently so we should be good to go. Please reopen if that's not the case.