Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook script "localclone.groovy" doesn't work #732

Closed
gitblit opened this issue Aug 12, 2015 · 4 comments
Closed

Hook script "localclone.groovy" doesn't work #732

gitblit opened this issue Aug 12, 2015 · 4 comments

Comments

@gitblit
Copy link
Collaborator

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 436

What steps will reproduce the problem?
1. Edit "localclone.groovy" and change line 76 to:
        def rootFolder = '/tmp'
2. Add hook script on a repository.
3. Commit some changes to this repository.

What is the expected output? What do you see instead?
- Repository cloned a the directory I want.
- Nothing append. Logfile (/opt/gitblit/data/logs/gitblit.log) show this error:
2014-05-23 12:16:40 [ERROR] Failed to execute Groovy script localclone.groovy
groovy.lang.MissingMethodException: No signature of method: static com.gitblit.GitBlit.getRepositoriesFolder()
is applicable for argument types: () values: []
Possible solutions: getRepositoriesFolder()
    at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1359)
    at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1345)
    at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:50)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
    at localclone.run(localclone.groovy:84)
    at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:565)
    at com.gitblit.git.GitblitReceivePack.runGroovy(GitblitReceivePack.java:567)
    at com.gitblit.git.GitblitReceivePack.onPreReceive(GitblitReceivePack.java:313)
    at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:203)
    at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:160)
    at org.eclipse.jgit.http.server.ReceivePackServlet.doPost(ReceivePackServlet.java:187)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jgit.http.server.glue.UrlPipeline$Chain.doFilter(UrlPipeline.java:237)
    at org.eclipse.jgit.http.server.ReceivePackServlet$Factory.doFilter(ReceivePackServlet.java:144)
    at org.eclipse.jgit.http.server.glue.UrlPipeline$Chain.doFilter(UrlPipeline.java:235)
    at org.eclipse.jgit.http.server.RepositoryFilter.doFilter(RepositoryFilter.java:151)
    at org.eclipse.jgit.http.server.glue.UrlPipeline$Chain.doFilter(UrlPipeline.java:235)
    at org.eclipse.jgit.http.server.NoCacheFilter.doFilter(NoCacheFilter.java:80)
    at org.eclipse.jgit.http.server.glue.UrlPipeline$Chain.doFilter(UrlPipeline.java:235)
    at org.eclipse.jgit.http.server.glue.UrlPipeline.service(UrlPipeline.java:215)
    at org.eclipse.jgit.http.server.glue.SuffixPipeline.service(SuffixPipeline.java:101)
    at org.eclipse.jgit.http.server.glue.MetaFilter.doFilter(MetaFilter.java:175)
    at com.gitblit.servlet.GitServlet.service(GitServlet.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1651)
    at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:294)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1639)
    at com.gitblit.servlet.EnforceAuthenticationFilter.doFilter(EnforceAuthenticationFilter.java:86)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1639)
    at com.gitblit.servlet.AccessRestrictionFilter.doFilter(AccessRestrictionFilter.java:223)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1631)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:549)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
    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:462)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
    at java.lang.Thread.run(Thread.java:744)

What version of the product are you using? On what operating system?
Debian 7.4
Gitblit GO 1.5.1

Reported by julienr16 on 2014-05-23 10:30:43

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Original:

  def srcUrl = 'file://' + new File(GitBlit.getRepositoriesFolder(), ...

Change this to:

  def srcUrl = 'file://' + new File(gitblit.getRepositoriesFolder(), ...

Reported by James.Moger on 2014-05-23 11:59:07

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

That's working.
Many thanks. :)

Reported by julienr16 on 2014-05-23 12:04:22

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Thanks for the report.  Hotfix pushed to master & develop.

Reported by James.Moger on 2014-05-23 12:33:40

  • Status changed: Queued
  • Labels added: Milestone-1.6.0

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

1.6.0 released.

Reported by James.Moger on 2014-06-17 00:24:34

  • Status changed: Done

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix modified the milestone: 1.6.0 Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants