# \[SOLVED\] Unable to change Trusted status on all repositories

**URL:** <https://drone.discourse.group/t/solved-unable-to-change-trusted-status-on-all-repositories/11174>\
**Category:** Drone Support\
**Created:** [May 25, 2018, 6:47pm UTC](https://drone.discourse.group/t/solved-unable-to-change-trusted-status-on-all-repositories/11174 "2018-05-25T18:47:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecray](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ecray/32/5370_2.png) [@ecray](https://drone.discourse.group/u/ecray)\
**Post date:** [May 25, 2018, 6:47pm UTC](https://drone.discourse.group/t/solved-unable-to-change-trusted-status-on-all-repositories/11174/1 "2018-05-25T18:47:43Z")

</div>

I am unable to update repositories settings for Trusted. I am the site admin and owner for our on-premise Github Enterprise setup, as well as Drone cluster.

> drone repo update -trusted=true my\_org/repository  
> client error 403: Insufficient privileges

> drone user info ecray  
> client error 413: User not authorized

> version: ‘2’
> 
> services:  
> drone-server:  
> image: drone/drone:0.8  
> ports:  
> - 10.0.0.1:80:8000  
> - 9000  
> volumes:  
> - /srv/drone:/var/lib/drone/  
> restart: always  
> environment:  
> - DRONE\_OPEN=false  
> - DRONE\_ORGS=my\_org  
> - **DRONE\_ADMIN=ecray**  
> - DRONE\_HOST=[http://drone.example.com](http://drone.example.com)  
> - DRONE\_GITHUB=true  
> - DRONE\_GITHUB\_PRIVATE\_MODE=true  
> - DRONE\_GITHUB\_URL=[https://github.example.com](https://github.example.com)  
> - DRONE\_GITHUB\_CLIENT=  
> - DRONE\_GITHUB\_SECRET=  
> - DRONE\_SECRET=SeeCCrrEEtt

All documentation and other posts similar to my issue line up with my settings, but I am wondering if the GHE setup requires anything else. I see no info in any of the logs regarding this, so not sure how to troubleshoot any further.

Any help would be greatly appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [May 25, 2018, 7:00pm UTC](https://drone.discourse.group/t/solved-unable-to-change-trusted-status-on-all-repositories/11174/2 "2018-05-25T19:00:11Z")

</div>

> drone repo update -trusted=true my\_org/repository  
> client error 403: Insufficient privileges

This error comes from the following code:

```diff
+	if (in.IsTrusted != nil || in.Timeout != nil) && !user.Admin {
+ c.String(403, "Insufficient privileges")
		return
	}

```

> drone user info ecray  
> client error 413: User not authorized

And this error comes from the following code:

```diff
func MustAdmin() gin.HandlerFunc {
	return func(c *gin.Context) {
		user := User(c)
		switch {
		case user == nil:
			c.String(401, "User not authorized")
			c.Abort()
+ case user.Admin == false:
+ c.String(413, "User not authorized")
			c.Abort()
		default:
			c.Next()
		}
	}
}

```

In both cases this is failing because the user is not a recognized administrator. This would tell me the DRONE\_ADMIN parameter is not properly configured or is not picked up by your instance. The most common issue we see is that DRONE\_ADMIN usernames are case-sensitive, and are frequently configured with the wrong case.

> I am wondering if the GHE setup requires anything else

No additional configuration required.

> so not sure how to troubleshoot any further.

You can login to the user interface and visit `/api/user`. In an installation where the DRONE\_ADMIN parameter is properly configured the endpoint will return your user information with the admin flag set to true. For example, this is what I see:

```diff
{
  "id": 1,
  "login": "bradrydzewski",
  "synced": 1527024400,
+ "admin": true
}

```

---

<div class="post-metadata">

**Author:** ![ecray](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ecray/32/5370_2.png) [@ecray](https://drone.discourse.group/u/ecray)\
**Post date:** [May 25, 2018, 7:19pm UTC](https://drone.discourse.group/t/solved-unable-to-change-trusted-status-on-all-repositories/11174/3 "2018-05-25T19:19:46Z")

</div>

Thanks for the detailed info! My username is all lowercase, in both GHE and drone.

> “[id":1,“login”:“ecray”,“email”:"foobear@example.com](mailto:id%22:1,%22login%22:%22ecray%22,%22email%22:%22foobear@example.com)”,“avatar\_url”:“[https://github.example.com/avatars/u/93?",“active”:false,"synced](https://github.example.com/avatars/u/93?%22,%22active%22:false,%22synced)”:1527204934}

The /api/user endpoint does in fact show incorrect settings, strange to see the “active: false” parameter.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [May 25, 2018, 7:47pm UTC](https://drone.discourse.group/t/solved-unable-to-change-trusted-status-on-all-repositories/11174/4 "2018-05-25T19:47:29Z")

</div>

can you confirm the variable is properly passed to your drone server container via `docker inspect`? This is a slimmed-down example of what I see when for my drone server installation:

```diff
[
    {
        "Id": "739c26b5a5f6677a2febe938f6c3d919612d1d988423e90faa9877dd386e4113",
        "Args": [],
        "State": {
            "Status": "running",
            "Running": true
        },
        "Config": {
            "Env": [
                "DRONE_DEBUG=true",
                "DRONE_OPEN=false",
+ "DRONE_ADMIN=bradrydzewski"
            ],
            "Cmd": null,
            "ArgsEscaped": true,
            "Image": "drone/drone:latest",
            "Entrypoint": [
                "/bin/drone-server"
            ],
            "Labels": {
                "org.label-schema.build-date": "2018-05-03T00:07:21Z",
                "org.label-schema.vcs-ref": "29785b86f6534ded974120de0fcf7c21397a9d0d",
                "org.label-schema.vcs-url": "https://github.com/drone/drone.git"
            }
        }
    }
]
```

---

<div class="post-metadata">

**Author:** ![ecray](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ecray/32/5370_2.png) [@ecray](https://drone.discourse.group/u/ecray)\
**Post date:** [May 25, 2018, 8:13pm UTC](https://drone.discourse.group/t/solved-unable-to-change-trusted-status-on-all-repositories/11174/5 "2018-05-25T20:13:00Z")

</div>

It looks like docker-compose was caching the old data. I had to do a full docker-compose teardown, but that has fixed the problem. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![ricktian1226](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@ricktian1226](https://drone.discourse.group/u/ricktian1226)\
**Post date:** [October 19, 2019, 8:51am UTC](https://drone.discourse.group/t/solved-unable-to-change-trusted-status-on-all-repositories/11174/6 "2019-10-19T08:51:42Z")

</div>

and if “DRONE\_ADMIN” still no resolve the problem, maybe you can try “DRONE\_USER\_CREATE=username:ecray,admin:true”. I resolved my problem by this.
