setting up aosp mirror with gerrit - repo upload problem

792 views
Skip to first unread message

Asi Mugrabi

unread,
Apr 24, 2012, 2:35:52 AM4/24/12
to repo-d...@googlegroups.com
I have set up aosp mirror in gerrit server. After repo snyc, I can not repo upload to gerrit server correctly.
Further details: I repo init via ssh:
repo init -u gerrit2@git:mirrors/platform/manifest
then repo sync

In .repo/manifest.xml I changed the review to be http://git:8080
Finally After making changes -  repo upload
The problem is the project I am working on is frameworks/base and in repo upload it is uploading to platform/frameworks/base
So I change the project name in .repo/manifest.xml to frameworks/base and now upload works but this of course breaks repo sync

Please advise.
Thanks in advance,
Asi


Magnus Bäck

unread,
Apr 24, 2012, 9:29:06 AM4/24/12
to repo-d...@googlegroups.com
On Tuesday, April 24, 2012 at 02:35 EDT,
Asi Mugrabi <a...@nubosoftware.com> wrote:

> I have set up aosp mirror in gerrit server. After repo snyc, I can not
> repo upload to gerrit server correctly.
> Further details: I repo init via ssh:
> repo init -u gerrit2@git:mirrors/platform/manifest
> then repo sync

Why are you fetching as gerrit2?

> In .repo/manifest.xml I changed the review to be http://git:8080
> Finally After making changes - repo upload
> The problem is the project I am working on is frameworks/base and in
> repo upload it is uploading to platform/frameworks/base

Yes, this is expected. The name of that project (i.e. the relative
git path) is platform/frameworks/base, but the workspace path is
frameworks/base. The platform/ prefix is used for nearly all AOSP gits.

Why does the upload to platform/frameworks/base fail? It shouldn't.
What's the git structure on the server? It should coincide with the
structure used for fetching the data.

Any reason to fetch via SSH yet upload via HTTP?

> So I change the project name in .repo/manifest.xml to frameworks/base
> and now upload works but this of course breaks repo sync

Avoid making changes to the manifest if you can.

--
Magnus Bäck
ba...@google.com

Jean-Baptiste Queru

unread,
Apr 24, 2012, 10:16:43 AM4/24/12
to Repo and Gerrit Discussion
I suspect that you have seeded your server from a plain client, not
from an actually mirror. The server project should be
platform/frameworks/base.

In other words, I guess that you didn't use --mirror when you
downloaded the data from AOSP.

repo init -u https://android.googlesource.com/mirror/manifest --mirror

JBQ

> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Asi Mugrabi

unread,
Apr 25, 2012, 6:03:12 AM4/25/12
to repo-d...@googlegroups.com
Magnus and JBQ thank you for your replies.
@ JBQ - This is mirror

1. Why are you fetching as gerrit2?
I am fetching as gerrit because trying via repo init -u http://git/mirrors/platform/manifest results with messages:
http://git/mirrors/platform/manifest/info/refs not found: did you run git update-server-info on the server?
I ran git update-server-info on 1. mirrors 2. mirrors/platform 3. mirrors/platform/manifest.git but either one did not help.
I checked the path http://git/mirrors/platform/ in a browser to make sure and I can reach it and manifest.git is there.
Any advice on this issue? I can not find an answer on the web.

2. Any reason to fetch via SSH yet upload via HTTP?
Well I hope I can solve the problem above soon. HTTP is the preferred fetch.
Another important thing is in  gerrit.config I set the
basePath = /home/gerrit2/mirrors/platform/
Is this the correct path?
If I set it to basePath = /home/gerrit2/mirrors/ gerrit can not set the projects (internal error) in http://git:8080/ Admin->Projects

Any advice?

Thanks again.

Magnus Bäck

unread,
Apr 25, 2012, 8:57:31 AM4/25/12
to repo-d...@googlegroups.com
On Wednesday, April 25, 2012 at 06:03 EDT,
Asi Mugrabi <a...@nubosoftware.com> wrote:

> Magnus and JBQ thank you for your replies.
> @ JBQ - This is mirror
>

> 1. *Why are you fetching as gerrit2?*


> I am fetching as gerrit because trying via repo init -u
> http://git/mirrors/platform/manifest results with messages:
> http://git/mirrors/platform/manifest/info/refs not found: did you run
> git update-server-info on the server?

What's listening on git:80, Gerrit or something else? You're pushing to
port 8080 which presumably is Gerrit, so you should probably be fetching
from the same port.

This particular error message indicates that you're running Git 1.6.5 or
older since it's trying the old HTTP protocol (on the other hand, with
such an old Git I'm surprised you were able to fetch the AOSP code). Or,
you do have a sufficiently new Git, but your server hasn't been enabled
to serve the smart HTTP protocol so the client falls back to the legacy
protocol. The smart protocol is explained in more detail below.

http://progit.org/2010/03/04/smart-http.html

But again, strive for a symmetric setup where you fetch and push against
the same service.

[...]

> 2. *Any reason to fetch via SSH yet upload via HTTP?*


> Well I hope I can solve the problem above soon. HTTP is the preferred
> fetch. Another important thing is in gerrit.config I set the
> basePath = /home/gerrit2/mirrors/platform/
> Is this the correct path?

Which path is the correct one depends on what's in these directories. If
the contents of /home/gerrit2/mirrors is

platform/frameworks/base
platform/packages/apps/Browser
device/samsung/crespo
...

then basePath should be /home/gerrit2/mirrors if you want the gits to be
accessible via e.g. http://git:8080/platform/frameworks/base.

> If I set it to basePath = /home/gerrit2/mirrors/ gerrit can not set
> the projects (internal error) in http://git:8080/ Admin->Projects

Well, what's in the server logs?

--
Magnus Bäck
ba...@google.com

Asi Mugrabi

unread,
Apr 25, 2012, 10:37:15 AM4/25/12
to repo-d...@googlegroups.com
Magnus thank you so much for your aid. I was starting to lose any hope. I believe this is helpful for many others also.

1. Gerrit is listening on 8080 (  basePath = /home/gerrit2/mirrors/platform/ - I understand that i not correct). Port 80 is just a redirection to /home/gerrit2

if I try to fetch from git:8080 by either 
 
error: git:8080: <urlopen error [Errno 1] _ssl.c:480: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol>

I will read smart protocol as soon as I am able.
git version on server is 1.7.2.5 and on client is 1.7.0.4

2. The contents of /home/gerrit2/mirrors is a bit different:
platform/frameworks/base.git
platform/manifest.git
device/samsung
....

When I change  basePath to be /home/gerrit2/mirrors this is the error I receive in gerrit error_log.

[2012-04-25 10:27:26,740] ERROR com.google.gerrit.ehcache.PopulatingCache : Cannot lookup com.google.gerrit.server.project.ProjectCacheImpl$ListKey@757f98e7 in "project_list"
net.sf.ehcache.CacheException: Could not fetch object for cache entry with key "com.google.gerrit.server.project.ProjectCacheImpl$ListKey@757f98e7".
        at net.sf.ehcache.constructs.blocking.SelfPopulatingCache.get(SelfPopulatingCache.java:88)
        at com.google.gerrit.ehcache.PopulatingCache.get(PopulatingCache.java:84)
        at com.google.gerrit.server.cache.ProxyCache.get(ProxyCache.java:26)
        at com.google.gerrit.server.project.ProjectCacheImpl.all(ProjectCacheImpl.java:132)
        at com.google.gerrit.httpd.rpc.project.VisibleProjects.getProjects(VisibleProjects.java:58)
        at com.google.gerrit.httpd.rpc.project.VisibleProjects.call(VisibleProjects.java:51)
        at com.google.gerrit.httpd.rpc.project.VisibleProjects.call(VisibleProjects.java:31)
        at com.google.gerrit.httpd.rpc.Handler.to(Handler.java:65)
        at com.google.gerrit.httpd.rpc.project.ProjectAdminServiceImpl.visibleProjects(ProjectAdminServiceImpl.java:74)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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:382)
        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(ServletDefinition.java:216)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:141)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:93)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:63)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:134)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:134)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
        at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:76)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
        at com.google.gerrit.httpd.RequestCleanupFilter.doFilter(RequestCleanupFilter.java:54)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:134)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:122)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:921)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:856)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:59)
        at com.google.gerrit.pgm.http.jetty.JettyServer$1.handle(JettyServer.java:139)
        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(HttpConnection.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:426)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:510)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:450)
        at java.lang.Thread.run(Thread.java:662)

Any ideas?

Asi

Magnus Bäck

unread,
Apr 25, 2012, 11:29:43 AM4/25/12
to repo-d...@googlegroups.com
On Wednesday, April 25, 2012 at 10:37 EDT,
Asi Mugrabi <a...@nubosoftware.com> wrote:

> Magnus thank you so much for your aid. I was starting to lose any hope.
> I believe this is helpful for many others also.
>
> 1. Gerrit is listening on 8080 ( basePath =
> /home/gerrit2/mirrors/platform/ - I understand that i not correct).
> Port 80 is just a redirection to /home/gerrit2
>
> if I try to *fetch *from git:8080 by either
> 1.repo init -u https://git:8080/platform/manifest.git or 2. repo init -u
> https://git:8080/platform/manifest.git or 3. repo init -u
> https://git:8080/mirrors/platform/manifest.git- this is what i get:
>
> *Get https://git:8080/platform/manifest.git*
> *error: git:8080: <urlopen error [Errno 1] _ssl.c:480: error:140770FC:SSL
> routines:SSL23_GET_SERVER_HELLO:unknown protocol>*

Your webserver speaks HTTP on port 8080, not HTTPS. Either switch back
to HTTP, use the default HTTPS port (i.e. drop the :port part of the
URL), or specify another port to use for HTTPS traffic.

> I will read smart protocol as soon as I am able.
> git version on server is 1.7.2.5 and on client is 1.7.0.4
>
> 2. The contents of /home/gerrit2/mirrors is a bit different:
> platform/frameworks/base.git
> platform/manifest.git
> device/samsung
> ....

That's fine. I forgot about the .git extension to the directories.

> When I change basePath to be /home/gerrit2/mirrors this is the error
> I receive in gerrit error_log.
>
> [2012-04-25 10:27:26,740] ERROR
> com.google.gerrit.ehcache.PopulatingCache : Cannot lookup
> com.google.gerrit.server.project.ProjectCacheImpl$ListKey@757f98e7 in
> "project_list"
> net.sf.ehcache.CacheException: Could not fetch object for cache entry with
> key "com.google.gerrit.server.project.ProjectCacheImpl$ListKey@757f98e7".

Hmm, it looks like a stale project cache entry is causing this, but I
thought the project cache wasn't persistent across Gerrit restarts.
Hopefully someone else can explain this one.

[...]

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages