Table "projects" does not exist in my gerrit installation

1,021 views
Skip to first unread message

sradi

unread,
Sep 9, 2011, 3:07:14 AM9/9/11
to Repo and Gerrit Discussion
Hello,

I am new to gerrit and have configured my server (version 2.2.1) to
run with a H2 database.
I already created several projects over the web interface. But when I
run "ssh -p 29418 <user>@gitp01 gerrit gsql" and list all existing
tables, I get the following output:
List of relations
TABLE_SCHEM | TABLE_NAME | TABLE_TYPE
------------+------------------------------+-----------
PUBLIC | ACCOUNTS | TABLE
PUBLIC | ACCOUNT_AGREEMENTS | TABLE
PUBLIC | ACCOUNT_DIFF_PREFERENCES | TABLE
PUBLIC | ACCOUNT_EXTERNAL_IDS | TABLE
PUBLIC | ACCOUNT_GROUPS | TABLE
PUBLIC | ACCOUNT_GROUP_AGREEMENTS | TABLE
PUBLIC | ACCOUNT_GROUP_INCLUDES | TABLE
PUBLIC | ACCOUNT_GROUP_INCLUDES_AUDIT | TABLE
PUBLIC | ACCOUNT_GROUP_MEMBERS | TABLE
PUBLIC | ACCOUNT_GROUP_MEMBERS_AUDIT | TABLE
PUBLIC | ACCOUNT_GROUP_NAMES | TABLE
PUBLIC | ACCOUNT_PATCH_REVIEWS | TABLE
PUBLIC | ACCOUNT_PROJECT_WATCHES | TABLE
PUBLIC | ACCOUNT_SSH_KEYS | TABLE
PUBLIC | APPROVAL_CATEGORIES | TABLE
PUBLIC | APPROVAL_CATEGORY_VALUES | TABLE
PUBLIC | CHANGES | TABLE
PUBLIC | CHANGE_MESSAGES | TABLE
PUBLIC | CONTRIBUTOR_AGREEMENTS | TABLE
PUBLIC | PATCH_COMMENTS | TABLE
PUBLIC | PATCH_SETS | TABLE
PUBLIC | PATCH_SET_ANCESTORS | TABLE
PUBLIC | PATCH_SET_APPROVALS | TABLE
PUBLIC | SCHEMA_VERSION | TABLE
PUBLIC | STARRED_CHANGES | TABLE
PUBLIC | SYSTEM_CONFIG | TABLE
PUBLIC | TRACKING_IDS | TABLE

I am missing the "projects" table. Actually I just want to delete an
existing project in the database. But I can't execute "DELETE FROM
projects..."

Can anyone help me with this?

Thanks and regards
Stefan

Shawn Pearce

unread,
Sep 9, 2011, 12:59:22 PM9/9/11
to sradi, Repo and Gerrit Discussion
On Fri, Sep 9, 2011 at 00:07, sradi <sr...@web.de> wrote:
> I am new to gerrit and have configured my server (version 2.2.1) to
> run with a H2 database.
> I already created several projects over the web interface. But when I
> run "ssh -p 29418 <user>@gitp01 gerrit gsql" and list all existing
> tables, I get the following output:
...

> I am missing the "projects" table. Actually I just want to delete an
> existing project in the database. But I can't execute "DELETE FROM
> projects..."

That is correct. In 2.2.x and later, there is no projects table.

To remove a project from Gerrit, move its Git repository out of the
gerrit.basePath directory. Then either flush the project_list cache,
or restart the server.

sradi

unread,
Sep 12, 2011, 4:50:57 AM9/12/11
to Repo and Gerrit Discussion
Thank you for the helpful response! The deletion worked fine.
I am now trying to create a new project with the same name as the
previously deleted one. The directories are created, but it doesn't
appear in the project list. I already flushed all caches and restarted
the server, hoping this would result in a fresh, complete project
listing. Does anyone have a solution for this?


On 9 Sep., 18:59, Shawn Pearce <s...@google.com> wrote:
> On Fri, Sep 9, 2011 at 00:07, sradi <sr...@web.de> wrote:
> > I am new to gerrit and have configured my server (version 2.2.1) to
> > run with a H2 database.
> > I already created several projects over the web interface. But when I
> > run "ssh -p 29418 <user>@gitp01 gerrit gsql" andlistall existing
> > tables, I get the following output:
> ...
> > I ammissingthe "projects" table. Actually I just want to delete an
> > existingprojectin the database. But I can't execute "DELETE FROM
> > projects..."
>
> That is correct. In 2.2.x and later, there is no projects table.
>
> To remove aprojectfrom Gerrit, move its Git repository out of the

Matthias Sohn

unread,
Sep 12, 2011, 5:14:00 AM9/12/11
to sradi, Repo and Gerrit Discussion
2011/9/12 sradi <sr...@web.de>

Thank you for the helpful response! The deletion worked fine.
I am now trying to create a new project with the same name as the
previously deleted one. The directories are created, but it doesn't
appear in the project list. I already flushed all caches and restarted
the server, hoping this would result in a fresh, complete project
listing. Does anyone have a solution for this?

--
Matthias

sradi

unread,
Sep 12, 2011, 5:29:48 AM9/12/11
to Repo and Gerrit Discussion
Thanks, that's how I did create the project. Still, the project does
not show up in the projects list.

It works for project names, which haven't existed before, but doesn't
work for project names, that I've used before.

The exception I see in the server's error_log on opening the "Admin |
Projects" webpage is:
[2011-09-12 11:24:41,015] ERROR
com.google.gerrit.server.cache.PopulatingCache :
Cannot lookup edi/tr02 in "projects"
net.sf.ehcache.CacheException: Could not fetch object for cache entry
with key "
edi/tr02".
at
net.sf.ehcache.constructs.blocking.SelfPopulatingCache.get(SelfPopula
tingCache.java:88)
at
com.google.gerrit.server.cache.PopulatingCache.get(PopulatingCache.ja
va:85)
at
com.google.gerrit.server.project.ProjectCacheImpl.get(ProjectCacheImp
l.java:114)
at com.google.gerrit.server.project.ProjectControl
$Factory.controlFor(Pr
ojectControl.java:74)
at
com.google.gerrit.httpd.rpc.project.VisibleProjects.call(VisibleProje
cts.java:50)
at
com.google.gerrit.httpd.rpc.project.VisibleProjects.call(VisibleProje
cts.java:30)
at com.google.gerrit.httpd.rpc.Handler.to(Handler.java:65)
at
com.google.gerrit.httpd.rpc.project.ProjectAdminServiceImpl.visiblePr
ojects(ProjectAdminServiceImpl.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwtjsonrpc.server.MethodHandle.invoke(MethodHandle.java:91
)
at
com.google.gwtjsonrpc.server.JsonServlet.doService(JsonServlet.java:3
82)
at
com.google.gwtjsonrpc.server.JsonServlet.service(JsonServlet.java:268
)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
717)
at
com.google.inject.servlet.ServletDefinition.doService(ServletDefiniti
on.java:216)
at
com.google.inject.servlet.ServletDefinition.service(ServletDefinition
.java:141)
at
com.google.inject.servlet.ManagedServletPipeline.service(ManagedServl
etPipeline.java:93)
at
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainI
nvocation.java:63)
at
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.
java:134)
at
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainI
nvocation.java:59)
at
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.
java:134)
at
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainI
nvocation.java:59)
at
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.
java:134)
at
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainI
nvocation.java:59)
at
com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFi
lter.java:76)
at
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.
java:129)
at
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainI
nvocation.java:59)
at
com.google.gerrit.httpd.RequestCleanupFilter.doFilter(RequestCleanupF
ilter.java:54)
at
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.
java:129)
at
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainI
nvocation.java:59)
at
com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilte
rPipeline.java:122)
at
com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
at org.eclipse.jetty.servlet.ServletHandler
$CachedChain.doFilter(Servlet
Handler.java:1322)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java
:473)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl
er.java:921)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:
403)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle
r.java:856)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j
ava:117)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
.java:114)
at
org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogH
andler.java:59)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper
.java:114)
at org.eclipse.jetty.server.Server.handle(Server.java:352)
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.
java:596)
at org.eclipse.jetty.server.HttpConnection
$RequestHandler.content(HttpCo
nnection.java:1069)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:
805)
at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
at
org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:42
6)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEn
dPoint.java:510)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access
$000(SelectChann
elEndPoint.java:34)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint
$1.run(SelectChannelEnd
Point.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool
$2.run(QueuedThreadPool
.java:450)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing
tree 24e6223c
1c582c397c5320743e4f58f8eb172e77
at
org.eclipse.jgit.storage.file.WindowCursor.open(WindowCursor.java:126
)
at
org.eclipse.jgit.treewalk.CanonicalTreeParser.reset(CanonicalTreePars
er.java:193)
at org.eclipse.jgit.treewalk.TreeWalk.parserFor(TreeWalk.java:
982)
at org.eclipse.jgit.treewalk.TreeWalk.reset(TreeWalk.java:434)
at org.eclipse.jgit.treewalk.TreeWalk.forPath(TreeWalk.java:
119)
at
com.google.gerrit.server.git.VersionedMetaData.readFile(VersionedMeta
Data.java:257)
at
com.google.gerrit.server.git.VersionedMetaData.readUTF8(VersionedMeta
Data.java:248)
at
com.google.gerrit.server.git.ProjectConfig.readGroupList(ProjectConfi
g.java:247)
at
com.google.gerrit.server.git.ProjectConfig.onLoad(ProjectConfig.java:
175)
at
com.google.gerrit.server.git.VersionedMetaData.load(VersionedMetaData
.java:121)
at
com.google.gerrit.server.git.VersionedMetaData.load(VersionedMetaData
.java:96)
at com.google.gerrit.server.project.ProjectCacheImpl
$Loader.createEntry(
ProjectCacheImpl.java:217)
at com.google.gerrit.server.project.ProjectCacheImpl
$Loader.createEntry(
ProjectCacheImpl.java:197)
at com.google.gerrit.server.cache.PopulatingCache
$1.createEntry(Populati
ngCache.java:55)
at
net.sf.ehcache.constructs.blocking.SelfPopulatingCache.get(SelfPopula
tingCache.java:72)
... 53 more
> Try thishttp://gerrit-documentation.googlecode.com/svn/Documentation/2.2.0/cm...
>
> --
> Matthias

sradi

unread,
Sep 12, 2011, 9:44:36 AM9/12/11
to Repo and Gerrit Discussion
I found a solution / workaround:
When I use "ssh ... gerrit create-project ..." with --empty-commit,
the project appears correctly in the projects list.

Andreas

unread,
Nov 4, 2011, 6:49:07 AM11/4/11
to Repo and Gerrit Discussion
Whats problematic when moving the git repository is, that if you
create a new project with an identical name, you will see the reviews
and submits of the old project. Dunno if it will cause any
inconsistencies. Probably when equal commit ids will be generated,
which is unlikely gonna happen.
Reply all
Reply to author
Forward
0 new messages