Skip to content

All users were lost after a server failure (happend 2nd time to us) #938

@igormukhin

Description

@igormukhin

We had a server failure yesterday night (Blue screen, unexpected restart.) After the server and GitBlit (version 1.6.2) started again we found out that all our users and their repo permissions are gone. The file users.conf was completely new. Now we need to restore it from the backup.

This happen to us the second time. The first time it was 2 months ago. We had GitBlit 1.3.x or so.

It looks like GitBlit corrupts or deletes users.conf if it was stopped improperly.

I found no entry in the logs of GitBlit regarding the failure, so I looks like it was a complete failure of the operating system (BlueScreen).

This is what I found in the logs file at the server start:

2015-10-07 01:32:02 [ERROR] Failed to read D:\gitblit-data\users.conf
org.eclipse.jgit.errors.ConfigInvalidException: Cannot read file D:\gitblit-data\users.conf
    at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:173)
    at com.gitblit.ConfigUserService.read(ConfigUserService.java:884)
    at com.gitblit.ConfigUserService.getUserModel(ConfigUserService.java:189)
    at com.gitblit.manager.UserManager.getUserModel(UserManager.java:204)
    at com.gitblit.manager.AuthenticationManager.authenticate(AuthenticationManager.java:370)
    at com.gitblit.manager.AuthenticationManager.authenticate(AuthenticationManager.java:277)
    at com.gitblit.servlet.GitFilter.getUser(GitFilter.java:124)
    at com.gitblit.servlet.AccessRestrictionFilter.doFilter(AccessRestrictionFilter.java:159)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
    at com.gitblit.servlet.ProxyFilter$1.doFilter(ProxyFilter.java:74)
    at com.gitblit.servlet.ProxyFilter.doFilter(ProxyFilter.java:77)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:497)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.eclipse.jgit.errors.ConfigInvalidException: Invalid line in config file
    at org.eclipse.jgit.lib.Config.fromText(Config.java:1087)
    at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:161)
    ... 28 more

Looking at the code of JGit the exception ConfigInvalidException means that the file was in place but the content was corrupted. In this case I suppose GitBlit should make a backup copy of the file like users.conf-datetime-corrupted before overwriting the file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions