# Hangfire dashboard gets stuck enqueueing jobs from list

**URL:** <https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095>\
**Category:** bug?\
**Tags:** dashboard\
**Created:** [June 25, 2015, 5:16pm UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095 "2015-06-25T17:16:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Wallace](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/james_wallace/32/298_2.png) [@James\_Wallace](https://discuss.hangfire.io/u/James_Wallace)\
**Post date:** [June 25, 2015, 5:16pm UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/1 "2015-06-25T17:16:32Z")

</div>

Hi there.

Just started using hangfire. All looks good apart from on the dashboard when I click ‘Enqueue Jobs’  
 ![](https://europe1.discourse-cdn.com/flex017/uploads/hangfire/original/1X/85317fcc6c06879a1ecbc741f3429a3ffb82c09d.png)

The dashboard seems to go into the Enqueueing state but then never Enqueues anything.  
 ![](https://europe1.discourse-cdn.com/flex017/uploads/hangfire/original/1X/52adca7a267628501f5c96e0b769bc62bda01766.png)

If I open an individual job and Click Re-Enqueue it gets added fine.

Cant see anyone else talking about this, so it must be something I am doing wrong 😉

---

<div class="post-metadata">

**Author:** ![shoebsd](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@shoebsd](https://discuss.hangfire.io/u/shoebsd)\
**Post date:** [July 15, 2015, 10:48am UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/2 "2015-07-15T10:48:48Z")

</div>

I have the same issue. I am trying to use Hangfire with Autofac in an [ASP.NET](http://ASP.NET) MVC application.  
I have also included ElmahLogProvider to log if any errors are encountered, but I don’t see any error out there.

The method gets enqueued in background job and never gets executed.

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [July 23, 2015, 3:22pm UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/3 "2015-07-23T15:22:55Z")

</div>

This issue may be caused by the following reasons that were fixed in [Hangfire 1.4.4](https://github.com/HangfireIO/Hangfire/releases/tag/v1.4.4):

1. `InvalidCastException` in Dashboard when using Microsoft.Owin 3.0.1 package.
2. One of middleware components in your project reads the request body without rewinding it back to the beginning.

---

<div class="post-metadata">

**Author:** ![Darren\_Maddox](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@Darren\_Maddox](https://discuss.hangfire.io/u/Darren_Maddox)\
**Post date:** [July 24, 2015, 11:02am UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/4 "2015-07-24T11:02:15Z")

</div>

I am still having the issue on 1.4.4 in a Windows Service. It appears that all Web API requests are failing with error 500. However it appears that it is working fine in our [ASP.NET](http://ASP.NET) application.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [July 24, 2015, 11:12am UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/5 "2015-07-24T11:12:02Z")

</div>

@Darren_Maddox, one of middleware components in your project is likely to read the body stream (using `ReadFormAsync` or directly the `Request.Body` stream), but does not buffer it into `MemoryStream`, making it seekable.

500 error contains the details, I’m sure it is _Can’t read the request body: stream is not at the beginning position and is not seekable._. This error message says that someone else already read the body stream, and Hangfire can’t do anything – it can’t read it, because current position is at the end, and it can’t seek it, because it is not buffered.

There are some middleware components ([this](https://katanaproject.codeplex.com/SourceControl/latest#src/Microsoft.Owin.Security.WsFederation/WsFederationAuthenticationHandler.cs) or [this](https://github.com/IdentityServer/IdentityServer3/blob/06ab9cf55996444c89f1aa2db61aba8646ebcf8c/source/Core/Configuration/Hosting/AntiForgeryToken.cs#L133), I’ve seen others) that read the body, however they replace the body stream with buffered versions and rewind the stream back to the beginning.

Please ensure your middleware is not egoist and allow others to access the body.

---

<div class="post-metadata">

**Author:** ![Darren\_Maddox](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@Darren\_Maddox](https://discuss.hangfire.io/u/Darren_Maddox)\
**Post date:** [July 24, 2015, 11:49am UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/6 "2015-07-24T11:49:18Z")

</div>

The 500 response is empty.

I threw together a quick console app with nothing but Hangfire & OWIN.

Program.cs

```
    static void Main(string[] args)
    {
        GlobalConfiguration.Configuration.UseSqlServerStorage(@"<Connection String Here>");
        var wa = WebApp.Start<Startup>(url: "http://localhost:9005");
        RecurringJob.AddOrUpdate(() => Console.WriteLine("Ping"), Cron.Minutely);
        Console.ReadLine();
        wa.Dispose();
    }

```

StartUp.cs

```
    public void Configuration(IAppBuilder app)
    {
        // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888
        app.UseHangfireDashboard();
        app.UseHangfireServer();
    }

```

It still seems to have the same issue. The dashboard loads but Web API requests fail. If I’m doing something dumb let me know 🙂

---

<div class="post-metadata">

**Author:** ![Darren\_Maddox](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@Darren\_Maddox](https://discuss.hangfire.io/u/Darren_Maddox)\
**Post date:** [July 24, 2015, 11:55am UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/7 "2015-07-24T11:55:23Z")

</div>

It works after downgrading to 1.4.3

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [July 24, 2015, 12:26pm UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/8 "2015-07-24T12:26:32Z")

</div>

Thanks for this post! I’ve added `UseErrorPage` method…

```auto
app.UseErrorPage();
app.UseHangfireDashboard();
app.UseHangfireServer();

```

… and found NotSupportException “This stream does not support seek operations.”, a bug in 1.4.4. I’ve just released 1.4.5 with hotfix for this problem, however it is totally unrelated yto your previous one.

Are you using Web Api? Here is a [similar problem](http://stackoverflow.com/questions/21805362/rewind-request-body-stream) on SO.

---

<div class="post-metadata">

**Author:** ![Darren\_Maddox](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@Darren\_Maddox](https://discuss.hangfire.io/u/Darren_Maddox)\
**Post date:** [July 24, 2015, 12:36pm UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/9 "2015-07-24T12:36:11Z")

</div>

Can confirm the issue is resolved!

Smashing thanks for all your help!

I think I have confused you some what. I have two applications using Hangfire, an [ASP.NET](http://ASP.NET) one which has always been working and showed no symptoms and a new service application which had the issue which you have now resolved.

Thanks for your help have a good one!

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [July 24, 2015, 12:42pm UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/10 "2015-07-24T12:42:05Z")

</div>

Ok, good to hear, thank you for reporting a bug!

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [July 24, 2015, 3:09pm UTC](https://discuss.hangfire.io/t/hangfire-dashboard-gets-stuck-enqueueing-jobs-from-list/1095/11 "2015-07-24T15:09:02Z")

</div>


