# \[Server Bootstrapper\] ERROR Hangfire.Server.ServerBootstrapper

**URL:** <https://discuss.hangfire.io/t/server-bootstrapper-error-hangfire-server-serverbootstrapper/1232>\
**Category:** bug?\
**Tags:** postgres\
**Created:** [August 14, 2015, 7:23pm UTC](https://discuss.hangfire.io/t/server-bootstrapper-error-hangfire-server-serverbootstrapper/1232 "2015-08-14T19:23:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![topish](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/topish/32/979_2.png) [@topish](https://discuss.hangfire.io/u/topish)\
**Post date:** [August 14, 2015, 7:23pm UTC](https://discuss.hangfire.io/t/server-bootstrapper-error-hangfire-server-serverbootstrapper/1232/1 "2015-08-14T19:23:35Z")

</div>

I’m seeing this error in the logs repeatedly. What is cause? Looks like a column length in one of the tables created in hangfire scheme is not long enough.

Error occurred during execution of ‘Server Bootstrapper’ component. Execution will be retried (attempt 20 of 2147483647) in 00:05:00 seconds.  
Npgsql.NpgsqlException:  
value too long for type character varying(50)  
Severity: ERROR  
Code: 22001  
at Npgsql.NpgsqlState.d\_\_0.MoveNext()  
at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject(Boolean cleanup)  
at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription()  
at Npgsql.ForwardsOnlyDataReader.NextResultInternal()  
at Npgsql.ForwardsOnlyDataReader…ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean preparedStatement, NpgsqlRowDescription rowDescription) at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) at Npgsql.NpgsqlCommand.ExecuteNonQuery() at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader)  
at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command)  
at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType)  
at Hangfire.PostgreSql.PostgreSqlConnection.AnnounceServer(String serverId, ServerContext context)  
at Hangfire.Server.ServerBootstrapper.Execute(CancellationToken cancellationToken)  
at Hangfire.Server.AutomaticRetryServerComponentWrapper.ExecuteWithAutomaticRetry(CancellationToken cancellationToken)

---

<div class="post-metadata">

**Author:** ![topish](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/topish/32/979_2.png) [@topish](https://discuss.hangfire.io/u/topish)\
**Post date:** [August 14, 2015, 7:37pm UTC](https://discuss.hangfire.io/t/server-bootstrapper-error-hangfire-server-serverbootstrapper/1232/2 "2015-08-14T19:37:34Z")

</div>

I only see one column setup as character varying (50) and that is id column in the server table.  
and my server name is much smaller than 50 chars so not sure why i’m seeing this error message in my logs.

---

<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:** [August 15, 2015, 11:00am UTC](https://discuss.hangfire.io/t/server-bootstrapper-error-hangfire-server-serverbootstrapper/1232/3 "2015-08-15T11:00:39Z")

</div>

Hi @topish, what exactly is your server name? Please post here the code that contains assignment to `ServerName` property. Please note that Hangfire appends a given server name with the process identifier, but it is usually 4-6 characters.

---

<div class="post-metadata">

**Author:** ![topish](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/topish/32/979_2.png) [@topish](https://discuss.hangfire.io/u/topish)\
**Post date:** [August 17, 2015, 2:42pm UTC](https://discuss.hangfire.io/t/server-bootstrapper-error-hangfire-server-serverbootstrapper/1232/4 "2015-08-17T14:42:28Z")

</div>

So the server name is being saved as ztrldnb118:5372, machine name: some hangfire generated integer.  
This is just using the defaults,  
I’m not sure why I see the string truncation issue. Clearly under 50 chars right there.

```
               var sb =
                new NpgsqlConnectionStringBuilder(
                    ConfigurationManager.ConnectionStrings["connection_config"].ConnectionString)
                {
                    Pooling = false
                };

            var storage = new PostgreSqlStorage(sb.ConnectionString);
            Hangfire.GlobalConfiguration.Configuration.UseStorage(storage);
            JobStorage.Current = storage;
            Hangfire.GlobalConfiguration.Configuration.UseLog4NetLogProvider();

            hf.UseHangfireServer();

            var svc = SomeUrl.AbsolutePath;
            hf.UseHangfireDashboard("/dashboard",
                new DashboardOptions
                {
                    AppPath = VirtualPathUtility.ToAbsolute(svc),
                    AuthorizationFilters = Enumerable.Empty<Hangfire.Dashboard.IAuthorizationFilter>()
                }, storage);

```

When I try modifying the server name or the worker count as illustrated in the docs, I am unable to have any available servers.  
The following doesn’t work when inserting this code before the call to UseHangfireServer in the above example.

```
           var options = new BackgroundJobServerOptions
            {
                WorkerCount = 25,
                ServerName = string.Format("{0}.{1}".FormatWith(Environment.MachineName, Guid.NewGuid()))
            };

            var server = new BackgroundJobServer(options, storage);
            hf.UseHangfireServer(options, storage);
```

---

<div class="post-metadata">

**Author:** ![yngndrw](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/yngndrw/32/83_2.png) [@yngndrw](https://discuss.hangfire.io/u/yngndrw)\
**Post date:** [August 18, 2015, 10:17pm UTC](https://discuss.hangfire.io/t/server-bootstrapper-error-hangfire-server-serverbootstrapper/1232/5 "2015-08-18T22:17:41Z")

</div>

Are you using the dev branch ? It looks like the generated server name now includes a GUID which is appended to the end:  
[https://github.com/HangfireIO/Hangfire/blob/dev/src/Hangfire.Core/Server/BackgroundServer.cs#L111](https://github.com/HangfireIO/Hangfire/blob/dev/src/Hangfire.Core/Server/BackgroundServer.cs#L111)

---

<div class="post-metadata">

**Author:** ![topish](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/topish/32/979_2.png) [@topish](https://discuss.hangfire.io/u/topish)\
**Post date:** [August 18, 2015, 10:36pm UTC](https://discuss.hangfire.io/t/server-bootstrapper-error-hangfire-server-serverbootstrapper/1232/6 "2015-08-18T22:36:44Z")

</div>

nope, not dev branch. would be latest nuget version.
