Foreman 1.4 db:migrate failing on UpdateFormatUrl

Hi,

I'm trying to upgrade our Foreman install from 1.3 to 1.4. It's
currently failing during the db:migrate stage:

== UpdateForemanUrl: migrating

··· =============================================== rake aborted! An error has occurred, this and all later migrations canceled:

ActiveRecord::ReadOnlyRecord
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

The settings.value for settings.name=“foreman_url” is currently set to:
"— foreman.int.corefiling.com

"

I tried adding a https:// to the front of the domain, setting it to the
default value and also to NULL. The migrate step still fails.

I don’t quite understand the ruby in
20131104132542_update_foreman_url.rb enough to really know what it’s
attempting to do.

Can anyone help?
Dan

Any idea why would your db be in read only mode? can you do
foreman-rake db:migrate --trace ?

thanks,

··· On Wed, Feb 12, 2014 at 2:40 PM, Daniel Piddock wrote:

== UpdateForemanUrl: migrating

rake aborted!
An error has occurred, this and all later migrations canceled:

ActiveRecord::ReadOnlyRecord

No idea. It has been making other changes (like deleting a column on
user_roles I had to create for it to delete). I think that suggests our
database got out of sync with the expected state at some point.

foreman owns the database. It's postgresql.

–trace attached. Debian Wheezy system using the debs from theforeman's
archive.

Dan

trace (6.22 KB)

··· On 12/02/14 12:58, Ohad Levy wrote: > > On Wed, Feb 12, 2014 at 2:40 PM, Daniel Piddock > <dgp-goog@corefiling.co.uk > wrote: > > > == UpdateForemanUrl: migrating > =============================================== > rake aborted! > An error has occurred, this and all later migrations canceled: > > ActiveRecord::ReadOnlyRecord > > > > Any idea why would your db be in read only mode? can you do > foreman-rake db:migrate --trace ?

>
>
>
>>
>> == UpdateForemanUrl: migrating
>> ===============================================
>> rake aborted!
>> An error has occurred, this and all later migrations canceled:
>>
>> ActiveRecord::ReadOnlyRecord
>
>
>
> Any idea why would your db be in read only mode? can you do
> foreman-rake db:migrate --trace ?
>
>
> No idea. It has been making other changes (like deleting a column on
> user_roles I had to create for it to delete). I think that suggests our
> database got out of sync with the expected state at some point.
>

indeed, did you change the db manually?

>
> foreman owns the database. It's postgresql.
>

do you have the same setting in /etc/foreman/settings.yml ? remove it if
you do.

Ohad

··· On Wed, Feb 12, 2014 at 3:12 PM, Daniel Piddock wrote: > On 12/02/14 12:58, Ohad Levy wrote: > On Wed, Feb 12, 2014 at 2:40 PM, Daniel Piddock > wrote:

–trace attached. Debian Wheezy system using the debs from theforeman’s
archive.

Dan


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

>
>
>
>
>>
>>
>>
>> == UpdateForemanUrl: migrating
>> ===============================================
>> rake aborted!
>> An error has occurred, this and all later migrations canceled:
>>
>> ActiveRecord::ReadOnlyRecord
>>
>>
>>
>> Any idea why would your db be in read only mode? can you do
>> foreman-rake db:migrate --trace ?
>
> No idea. It has been making other changes (like deleting a column
> on user_roles I had to create for it to delete). I think that
> suggests our database got out of sync with the expected state at
> some point.
>
>
> indeed, did you change the db manually?

I did to get around this problem. I don't believe we have previously.
It's been upgraded since our first install of 0.something.

>
> foreman owns the database. It's postgresql.
>
>
> do you have the same setting in /etc/foreman/settings.yml ? remove it
> if you do.
>

Ahha, removing the :foreman_url from settings.yml fixed the problem.
db:migrate managed to hit the end without throwing any more issues and
foreman is now working again, thank you.

Dan

··· On 12/02/14 13:21, Ohad Levy wrote: > On Wed, Feb 12, 2014 at 3:12 PM, Daniel Piddock > <dgp-goog@corefiling.co.uk > wrote: > On 12/02/14 12:58, Ohad Levy wrote: >> On Wed, Feb 12, 2014 at 2:40 PM, Daniel Piddock >> <dgp-goog@corefiling.co.uk > wrote: