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

jenkins와의 webhook 연동이 되지 않습니다. #401

Open
kslhunter opened this issue Jun 29, 2018 · 8 comments
Open

jenkins와의 webhook 연동이 되지 않습니다. #401

kslhunter opened this issue Jun 29, 2018 · 8 comments
Assignees

Comments

@kslhunter
Copy link

jenkins와의 webhook 연동이 되지 않습니다.

여러가지로 검색후, 제가 설정한 사항은 다음과 같습니다.

  • yona webhook 설정
    yona_webhook_
    (http://[아이디]:[암호]@[IP]:[PORT]/job/simplism8/build?token=push)

  • JENKINS 빌드유발 설정
    jenkins_ _

  • jenkins CSRF 설정
    jenkins_csrf_

아래 명령을 보냈을 때 JENKINS가 정상적으로 동작합니다.

curl -X POST http://[아이디]:[암호]@[IP]:[PORT]/job/simplism8/build?token=push

서버는, 윈도우즈고, 설치 버전은 "yona-v1.9.1-mariadb-10.1" 입니다.

최대한 자세하게 쓴다고 썼는데 도움이 되실지 모르겠네요,

제가 무언가 잘못 설정한 것인지, 혹은, 버그인지 확인 부탁드립니다.

@doortts
Copy link
Collaborator

doortts commented Jun 29, 2018

Yona 서버에도 webhook 호출시 로그가 남을텐데요 혹시 확인 가능할까요?

@kslhunter
Copy link
Author

kslhunter commented Jun 29, 2018

로그는 아래와 같습니다.

2018-06-30 05:41:20,014 - [INFO] - from application in play-akka.actor.default-dispatcher-37 
[Webhook] Request responded code 403: Forbidden

2018-06-30 05:41:20,014 - [INFO] - from application in play-akka.actor.default-dispatcher-37 
[Webhook] Request payload: {"ref":["refs/heads/master"],"commits":[{"id":"52a5d13149c74000231507edaf062072d4c9a694","message":"Jenkins 테스트를 위한 푸쉬\n","timestamp":"2018-06-30T05:41:15+0900","url":"http://localhost:9000/[아이디]/[패키지명]/commit/52a5d13149c74000231507edaf062072d4c9a694","author":{"name":"[이름]","email":"[이메일]"},"committer":{"name":"[이름]","email":"[이메일]"}}],"head_commit":{"id":"52a5d13149c74000231507edaf062072d4c9a694","message":"Jenkins 테스트를 위한 푸쉬\n","timestamp":"2018-06-30T05:41:15+0900","url":"http://localhost:9000/[아이디]/[패키지명]/commit/52a5d13149c74000231507edaf062072d4c9a694","author":{"name":"[이름]","email":"[이메일]"},"committer":{"name":"[이름]","email":"[이메일]"}},"sender":{"login":"[아이디]","id":1,"avatar_url":"/assets/images/default-avatar-128.png","type":"User","site_[아이디]":true},"pusher":{"name":"[이름]","email":"[이메일]"},"repository":{"id":1,"name":"[패키지명]","owner":"[아이디]","html_url":"/[아이디]/[패키지명]","overview":"[오버뷰]","private":true}}

([이름]에 한글(UTF-8)포함, [오버뷰]에 한글(UTF-8)포함)

curl로는 동작하는데, yona에서는 왜 403이 뜨는지 모르겠네요.

  • Jenkins 버전: Jenkins ver. 2.121.1

  • 추가로 로그에 "Request payload"외에 "Request Header"도 같이 나오면 좋을듯 합니다.

@kslhunter
Copy link
Author

kslhunter commented Jun 29, 2018

Jenkins 쪽에서 onRequest 로그도 찍어봤습니다.

6월 30, 2018 6:38:16 오전 미세 org.eclipse.jetty.server.HttpChannel onRequest
REQUEST for //[IP]:[PORT]/job/simplism8/build?token=push on HttpChannelOverHttp@14be84e{r=1,c=false,a=IDLE,uri=//210.180.118.73:60180/job/[패키지]/build?token=push}
POST //[IP]:[PORT]/job/[패키지]/build?token=push HTTP/1.1
Host: [IP]:[PORT]
Authorization: token
Content-Type: application/json; charset=UTF-8
Authorization: Basic [정상인증키]
Connection: keep-alive
Accept: */*
User-Agent: Yobi-Hookshot
Content-Length: 1081

음? 중간에 Authorization: token가 끼어있네요.

물론 웹후크 설정할때 "Authorization token"란은 비워두었습니다.

저것 때문인것 같네요.

실제로 아래는 동작하지 않고

curl -X POST -I -H "Authorization: token" -H "Authorization: [정상인증키]" http://[IP]:[PORT]/job/[패키지]/build?token=push

아래는 동작합니다.

curl -X POST -I "Authorization: [정상인증키]" http://[IP]:[PORT]/job/[패키지]/build?token=push

@doortts
Copy link
Collaborator

doortts commented Jul 6, 2018

관련해서 아래 두 이슈를 확인해 주시겠어요?

#103
#307 (comment)

@kslhunter
Copy link
Author

말씀해주신 두가지 이슈를 처음 이슈작성하기전에 모두 확인하고,
해당 이슈들을 참고하여, 첫 이슈의 내용대로 설정을 해본것이네요.

  • 아래의 Authnetication 헤더가 중복되서 그런건 아닌가요?
    capture

@doortts
Copy link
Collaborator

doortts commented Jul 6, 2018

아. Basic 헤더를 이용해서 인증을 하고 계신가요?

@doortts
Copy link
Collaborator

doortts commented Jul 6, 2018

혹시 #385 (comment) 이것도 보셨어요?

@kslhunter
Copy link
Author

#385 도 물론 확인한 상태구요 ㅠㅠ,

Basic헤더 관련하여, 따로 설정을 하고있지는 않습니다.

첫 이슈 발의때 표기한 설정 외에 다른 설정을 한것은 없습니다.

위의 형광펜으로 칠한 내용은 Jenkins의 Request로그이구요.

물론, "yona"상에서, 웹후크 설정할때 "Authorization token"란은 비워두었습니다.

여전히, 아래 명령은 잘 작동합니다.

curl -X POST http://[아이디]:[암호]@[IP]:[PORT]/job/simplism8/build?token=push

위의 명령으로 처리시, Jenkins측 로그입니다.

REQUEST for //[IP]:[PORT]/job/simplism8/build?token=push on HttpChannelOverHttp@2e76b0{r=1,c=false,a=IDLE,uri=//[IP]:[PORT]/job/simplism8/build?token=push}
POST //[IP]:[PORT]/job/simplism8/build?token=push HTTP/1.1
Host: [IP]:[PORT]
Authorization: Basic [정상인증키]
User-Agent: curl/7.60.0
Accept: */*

필요한 정보가 더 있으시면, 뒤질수 있는건 다 뒤져서, 스샷찍어 올릴게요 ㅠㅠ

개인적으론,

  1. 웹후크 설정할때 "Autheorization token"란을 비워놨음에도 불구하고
  2. 해당 헤더(Authorization: token)가 토큰은 비어있는 상태로 Request에 포함되는 문제가 아닐까?
  3. 하고 조심스레 생각해 봅니다. @_@

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

3 participants