본문 바로가기
CI, CD

[Heroku] Heroku and Github : Items could not be retrieved, Internal server error

by 푸고배 2022. 5. 5.

node로 만든 개인프로젝트를 간단하게 호스팅하기 위해서 Heroku를 사용하고 있다.

원래는 Heroku Git CLI를 사용하다가, Deployment methodConnect to Github Automatic deployment가 가능하길래 후자를 사용하던 중이었다. 그러나, 메일로 날라온 Automatic deployment Fail 안내

An automatic deployment for bus-information-site failed. The build failed with the message Unauthorized.
Token from user was used to interact with GitHub. This account was matched as the GitHub committer.You can also check that the user who connected the app or pipeline to GitHub still has access to the app and to the Github repository.In this case, reconnecting to GitHub will often fix the issue.If you believe that this build failure was not due to an issue in your app, please open a support ticket.

 

Automatic deployment

Heroku는 Github와 통합되어 Github에 있는 코드를 Heroku에서 실행되는 앱에 쉽게 배포할 수 있다. Github 통합이 Heroku 앱에 대해 구성되면 Heroku는 자동으로 빌드 및 릴리즈(빌드가 성공한 경우)를 지정된 GitHub repository로 푸시할 수 있다. 

자동 배포는 GitHub Branch에 대한 자동 배포를 활성화하면 Heroku가 모든 푸시를 빌드하고 해당 branch에 배포한다. 예를 들어 Heroku에 개발 앱이 있는 경우 Github development branch에 대한 푸시가 자동으로 빌드되고 해당 앱에 배포되도록 구성할 수 있다.

 

자동화된 지속적 통합(예: Travis CI 사용)을 사용하도록 GitHub Repository를 구성한 경우 "배포 전에 CI가 통과할 때까지 대기"(위 사진에서 Wait for CI to pass before deploy) 확인란을 선택할 수 있다. 활성화되면 Heroku는 관련된 커밋의 모든 커밋이 success가 된 후에만 자동 배포한다. 

왼쪽 커밋은 하나가 pending 상태이기 때문에, 자동 배포가 실행되지 않으나, 오른쪽은 모든 상태가 success이기 때문에 자동 배포가 실행된다.

 

발생 원인 및 해결 방법

발생 원인

 

Heroku Help

Select a topic, then pick a category and we'll show you commonly asked questions and answers. Looking for more help? Ask the community or create a ticket to get it routed to the best person to answer it.

help.heroku.com

메일에 있는 링크를 따라가보니 Heroku에서 위와 같은 보안문제가 발생했었다고 한다. 

따라서 2022년 4월 16일자 보안 업데이트 내용으로 아래와 같이 Heroku Dashboard GitHub 통합에서 모든 OAtuth 토큰을 해지했다는 말이 있다. 

더보기

제목: Heroku 보안 업데이트: OAuth 토큰 취소됨

2022년 4월 16일 오후 5시(태평양 표준시)에 Salesforce는 Heroku Dashboard GitHub 통합에서 모든 OAuth 토큰의 해지를 완료했습니다. 이전에 언급했듯이 이렇게 하면 Heroku 대시보드 또는 Heroku 자동화를 통해 GitHub에서 앱을 배포할 수 없으며 대시보드의 일부 다른 작업은 더 이상 작동하지 않습니다. Heroku 대시보드를 통해 GitHub에 다시 연결할 수 없지만 다음 문서에서 사용할 수 있는 다른 코드 배포 방법을 계속 사용할 수 있습니다.

 

현재(2022년 5월 5일 기준)로서는 다른 배포 방법을 사용하는 것이 해결책이다. 

그렇다. 첫 번째 방법으로 돌아가라는 말이었다. (진짜 딱 한번 편하게 사용해봤네..)

 

Heroku Git & CLI를 이용한 배포 방법

Install the Heroku CLI

우선 Heroku CLI를 다운로드한다.

로그인 전이라면, 아래 명령어를 이용하여 Heroku 계정에 로그인하고 프롬프트에 따라 새 SSH 공개 키를 생성한다.

heroku login

 

Clone the repository

Git을 사용하여 bus-information-site의 소스코드를 로컬 시스템에 복제한다.

$ heroku git:clone -a example-app
$ cd example-app

기존에 앱이 존재하는 경우 아래 명령을 이용하면 된다.

$ heroku git:remote -a example-app
set git remote heroku to https://git.heroku.com/example-app.git

 

Deploy your changes

위에서 복제한 코드를 일부 변경하고 Git을 사용해 Heroku에 배포한다.

$ git add .
$ git commit -am "make it better"
$ git push heroku master

 


Reference

 

갑자기 잘 되던 Heroku Automatic deployment 가 안된다.

Heroku 야 왜 자동배포가 안되는거니..ㅠㅠ

velog.io

 

Heroku and Github : Items could not be retrieved, Internal server error

I simply want to connect to my GitHub account. When I do it, I get this error message as a small red pop up on the upper right side of the page: Items could not be retrieved, Internal server error.

stackoverflow.com

 

GitHub Integration (Heroku GitHub Deploys) | Heroku Dev Center

Last updated March 09, 2022 Heroku integrates with GitHub to make it easy to deploy code living on GitHub to apps running on Heroku. When GitHub integration is configured for a Heroku app, Heroku can automatically build and release (if the build is success

devcenter.heroku.com

 

반응형

댓글