Rebuild time broken in OBS 2.3.1

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Rebuild time broken in OBS 2.3.1

Malcolm Fernandes-2
We are using a local OBS instance (2.3.1 appliance) and the rebuild_time feature seems to be broken when we upgraded from OBS 2.1.

It worked for us in OBS 2.1

We have the perl-GD rpms installed.

From the webui production.log file, I see these errors:
[ERROR|# 9687] rescue_action: caught Errno::ENOENT: No such file or directory -
/tmp/d20120705-9687-11cssor/rebuild.png
[INFO |# 9687] Rendering template within layouts/application
[INFO |# 9687] Rendering error (400)
[FATAL|# 9687] /!\ FAILSAFE /!\  Thu Jul 05 14:19:02 -0700 2012
  Status: 500 Internal Server Error
  Mysql::Error: MySQL server has gone away: UPDATE `sessions` SET `data` = 'BAh7CjoKbG9naW4iDW1mZXJuYW5kOhBtb2JpbGVfdmlld0Y6C3Bhc3N3ZCIN\nbWZlcm5hbmQ6EF9jc3JmX3Rva2VuIjFNbGtaYTBybnZ6Ukpka3M4UXUyWmpX\nbEVwb3RDaWpVMnAzK2pRWU4yZ080PSIKZmxhc2hJQzonQWN0aW9uQ29udHJv\nbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==\n', `updated_at` = '2012-07-05 14:19:02' WHERE `id` = 4383
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
    /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/mysql_adapter.rb:324:in `execute'
....


I tried running the rebuild time on the build.opensuse.org site and it does not produce the rebuild graph, it just states the rebuildtime and the longest paths.
https://build.opensuse.org/project/rebuild_time?arch=x86_64&project=openSUSE%3AFactory&repository=standard

Thanks,

Mal


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Rebuild time broken in OBS 2.3.1

Srinidhi B
>>> On 7/7/2012 at 06:05 AM, "Malcolm Fernandes" <[hidden email]> wrote:
> We are using a local OBS instance (2.3.1 appliance) and the rebuild_time
> feature seems to be broken when we upgraded from OBS 2.1.
>
> It worked for us in OBS 2.1
>

Yes. There are a couple of (trivial) patches that I never sent to this list and neither did I send pull requests on github. Sorry about that.

>   Status: 500 Internal Server Error
>   Mysql::Error: MySQL server has gone away: UPDATE `sessions` SET `data` =

Let's start with this one...

"Mysql server has gone away" shows up because the webui code "forks" out the mkddistats process. When this forked process finishes, the db connection is also closed. To avoid this, you can add the following in config/database.yml under your current environment (usually, production):

  production:
    adapter: mysql
    ....
    reconnect: true

References:
http://stackoverflow.com/questions/8913476/using-fork-in-ruby-on-rails-for-creating-parallel-process

I didn't want to change the webui sources, so used the (highest rated) solution from:

http://stackoverflow.com/questions/100631/mysql-server-has-gone-away-with-rails

Next problem would need source change in webui. In app/controllers/project_controller.rb, you'll find a function called rebuild_time_png. I had to comment the first line of that function:

    redirect_to :action => "list_public" and return unless request.xhr?

I did this because from reading the sources inside views, I couldn't see anyway this function being called via an AJAX call. That's why this page would render the project list page every time.

I don't think you need any more changes to get the rebuild time page to render correctly. I'll try to send these changes via pull requests soon.

Srinidhi.

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Rebuild time broken in OBS 2.3.1

Malcolm Fernandes-2
> -----Original Message-----
> From: Srinidhi B [mailto:[hidden email]]
> Sent: Saturday, July 07, 2012 7:15 AM
> To: Malcolm Fernandes; [hidden email]
> Subject: Re: [opensuse-buildservice] Rebuild time broken in OBS 2.3.1
>
> >>> On 7/7/2012 at 06:05 AM, "Malcolm Fernandes"
> <[hidden email]> wrote:
> > We are using a local OBS instance (2.3.1 appliance) and the
> rebuild_time
> > feature seems to be broken when we upgraded from OBS 2.1.
> >
> > It worked for us in OBS 2.1
> >
>
> Yes. There are a couple of (trivial) patches that I never sent to this
> list and neither did I send pull requests on github. Sorry about that.
>
> >   Status: 500 Internal Server Error
> >   Mysql::Error: MySQL server has gone away: UPDATE `sessions` SET
> `data` =
>
> Let's start with this one...
>
> "Mysql server has gone away" shows up because the webui code "forks"
> out the mkddistats process. When this forked process finishes, the db
> connection is also closed. To avoid this, you can add the following in
> config/database.yml under your current environment (usually,
> production):
>
>   production:
>     adapter: mysql
>     ....
>     reconnect: true
>
> References:
> http://stackoverflow.com/questions/8913476/using-fork-in-ruby-on-rails-
> for-creating-parallel-process
>
> I didn't want to change the webui sources, so used the (highest rated)
> solution from:
>
> http://stackoverflow.com/questions/100631/mysql-server-has-gone-away-
> with-rails
>
> Next problem would need source change in webui. In
> app/controllers/project_controller.rb, you'll find a function called
> rebuild_time_png. I had to comment the first line of that function:
>
>     redirect_to :action => "list_public" and return unless request.xhr?
>
> I did this because from reading the sources inside views, I couldn't
> see anyway this function being called via an AJAX call. That's why this
> page would render the project list page every time.
>
> I don't think you need any more changes to get the rebuild time page to
> render correctly. I'll try to send these changes via pull requests
> soon.
>

Thanks, made these changes locally and it works now.

Cheers,

Mal


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]