Gerrit Repliction Plugin trying to import organization repository

227 views
Skip to first unread message

rr2...@gmail.com

unread,
Oct 5, 2015, 4:59:44 AM10/5/15
to Repo and Gerrit Discussion
I'm trying to import a repository into gerrit using the repliction plugin. However, I'm getting this error when trying to view the organization.

[2015-10-02 05:47:03,710] ERROR com.google.gerrit.pgm.http.jetty.HiddenErrorHandler : Error in POST /plugins/github/static/rep
ositories-list.gh
java.lang.NullPointerException
        at com.googlesource.gerrit.plugins.github.wizard.RepositoriesListController.getRepositories(RepositoriesListController
.java:91)

I'm trying to figure out if I've misconfigured something because no repositories are showing up and I'm not able to import a repository.

I'm using gerrit 2.11.3 and the github, replication, and singleusergroup plugins.

Thanks

Luca Milanesio

unread,
Oct 5, 2015, 5:05:51 AM10/5/15
to rr2...@gmail.com, Repo and Gerrit Discussion
Hi,
the NPE is here below:

  private PagedIterable<GHRepository> getRepositories(GitHubLogin hubLogin,
      String organisation) throws IOException {
    if (organisation.equals(hubLogin.getMyself().getLogin())) {
      return hubLogin.getMyself().listRepositories(config.repositoryListPageSize);
    } else {
      GHOrganization ghOrganisation =
          hubLogin.getMyself().getOrganizations().byLogin(organisation);
      return ghOrganisation.listRepositories(config.repositoryListPageSize); <<<<====== NPE
    }
  }
}

You may have possibly forgotten to include toe READ_ORG scope in your Gerrit config: without that OAuth permission GitHub wouldn’t return the list of your organisations.

Example:

[github]
scopes = USER_EMAIL,PUBLIC_REPO,READ_ORG

HTH

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

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Inloes

unread,
Oct 6, 2015, 6:28:29 PM10/6/15
to Luca Milanesio, Repo and Gerrit Discussion
Hi,

Thanks for the reply.

My scopes in my gerrit.config file are already set to:
scopes = USER_EMAIL,REPO,READ_ORG

Luca Milanesio

unread,
Oct 6, 2015, 6:38:09 PM10/6/15
to Jonathan Inloes, Repo and Gerrit Discussion
Ah … I remember now the problem, it’s GitHub changing the logic of the listing of organisations and the introduction of the read:org scope.

I needed to fix the code to use the new logic in:

The patch is only on master though :-( and not yet in the 2.11 branch.
Can you try to cherry-pick and build?

Luca.

Jonathan Inloes

unread,
Oct 6, 2015, 7:36:32 PM10/6/15
to Luca Milanesio, Repo and Gerrit Discussion
Thanks! It's working for me so far :)

Santhosh Subramanian

unread,
Feb 17, 2016, 4:15:50 AM2/17/16
to Repo and Gerrit Discussion
Hi,

I am struck at a similar error and have setup scope as like you and the log throws up the same as like here.

All my organization repos are listed as personal repos


Due to this even if i select my organization from dropdown no repos are listed.

What is the mistake and where is it going wrong ?

Regards
Santhosh

Luca Milanesio

unread,
Feb 17, 2016, 4:44:36 AM2/17/16
to Santhosh Subramanian, Repo and Gerrit Discussion
Hi Santosh,
about the NPE, see the code RepositoriesListController:91 at [1]: it seems that you do not have access to your organisation and thus the GitHub API return null :-(

The second problem you mentioned (All my organization repos are listed as personal repos) may be possibly related.

Luca.


Santhosh Subramanian

unread,
Feb 17, 2016, 9:26:56 AM2/17/16
to Repo and Gerrit Discussion, sans...@gmail.com
Hi luca,

Thanks luca for the headsup !

Poor me was of the opinion that it has public access because the organisation was created from my personal account thereby making me owner of that organisation.

But there is an internal setting in github that makes repos not visible to public, though it's a public repository. I had to change that and then it's fine now :)

Santhosh Subramanian

unread,
Feb 18, 2016, 5:39:31 AM2/18/16
to Repo and Gerrit Discussion, sans...@gmail.com
Hi luca,

In continuation to the below issue ( i have fixed the issue like i have said )...The private repositories in my organisation on not available for import ( they are not being displayed )..There is no error in log too..

The ssh key of the place where the gerrit is hosted is the same as the owner of the organization and hence that shouldn't be an issue. What else could be wrongly configured ?

My gerrit config :
[gerrit]
basePath = git
canonicalWebUrl = http://192.168.1.26:8080/
[database]
type = h2
database = db/ReviewDB
[index]
type = LUCENE
[auth]
type = HTTP
httpHeader = GITHUB_USER
httpExternalIdHeader = GITHUB_OAUTH_TOKEN
loginUrl = /login
loginText = Sign-in with GitHub
registerPageUrl = "/#/register"
[sendemail]
smtpServer = smtp.gmail.com
smtpServerPort = 587
smtpEncryption = TLS
smtpUser = x...@gmail.com
[container]
user = gerrit2
javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://*:8080/
filterClass = com.googlesource.gerrit.plugins.github.oauth.OAuthFilter
[cache]
directory = cache
[github]
clientId = 1d3f90f9a5afff25cf2d


On Wednesday, February 17, 2016 at 3:14:36 PM UTC+5:30, lucamilanesio wrote:

Santhosh Subramanian

unread,
Feb 19, 2016, 2:14:40 AM2/19/16
to Repo and Gerrit Discussion, sans...@gmail.com
Hi luca,

Any tip to this issue ?

Santhosh Subramanian

unread,
Feb 24, 2016, 8:11:20 AM2/24/16
to Repo and Gerrit Discussion, sans...@gmail.com
Anyone who can help with the issue ? The private repositories don't show up in the import tab in gerrit..though my ssh key and all have been present in the organization..Do i need a specific config for it ?


On Thursday, February 18, 2016 at 4:09:31 PM UTC+5:30, Santhosh Subramanian wrote:

dc...@netelastic.com

unread,
Sep 6, 2017, 2:59:22 AM9/6/17
to Repo and Gerrit Discussion, sans...@gmail.com
Yes, I have the same issue. I cannot see the private repos from my organization. Any solution?

Luca Milanesio

unread,
Sep 6, 2017, 4:17:27 AM9/6/17
to dc...@netelastic.com, Repo and Gerrit Discussion, sans...@gmail.com
Have you configured the OAuth scope to allow access to the private repositories?

Luca.

Daniel Cai

unread,
Sep 6, 2017, 1:41:57 PM9/6/17
to Luca Milanesio, Repo and Gerrit Discussion, sans...@gmail.com

Luca,

 

Yes, the trick was to add addition lines in the config to allow private repo.

 

Thanks,

Daniel

dc...@netelastic.com

unread,
Sep 8, 2017, 4:56:38 PM9/8/17
to Repo and Gerrit Discussion
The config I have is to add scopes = USER,REPO  in the gerrit config file:

[github]
scopes = USER,REPO
clientId = ***************************

Xcaliber Infotech

unread,
Jul 5, 2019, 6:09:24 AM7/5/19
to Repo and Gerrit Discussion

Hi,
after updating scopes also, I am not able to see private repos.

Bruno Moraes BVA Consultoria

unread,
Aug 11, 2021, 11:26:33 AM8/11/21
to Repo and Gerrit Discussion
here i am facing the same issue...
Not able to see private repos...
There is an specific scope for it???

Please let me know.
Thanks in advance for your attention and help

Luca Milanesio

unread,
Aug 11, 2021, 1:40:39 PM8/11/21
to Repo and Gerrit Discussion, Luca Milanesio, Bruno Moraes BVA Consultoria

On 11 Aug 2021, at 18:26, Bruno Moraes BVA Consultoria <br...@bvaconsultoria.com.br> wrote:

here i am facing the same issue... 
Not able to see private repos... 
There is an specific scope for it???

Not that I am aware of, however, you should check GitHub documentation at [1].

HTH

Luca.


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

--- 
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Bruno Moraes BVA Consultoria

unread,
Aug 11, 2021, 2:46:31 PM8/11/21
to Repo and Gerrit Discussion
When I try to sync my private repos is getting this error:
[HTTP GET /plugins/github-plugin/static/scope.html (brunobva from 179.xxx.xxx.xxx)] ERROR com.googlesource.gerrit.plugins.github.velocity.VelocityViewServlet : Error executing velocity template /static//scope.html
org.apache.velocity.exception.VelocityException: Reference $scopeDescription evaluated to null when attempting to render at /static//scope.html[line 53, column 53]

Do you guys already see something regard it?

Tks
Bruno Moraes
Reply all
Reply to author
Forward
0 new messages