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

HTTPError: Response code 502 (Bad Gateway) #3032

Open
yeelimtse opened this issue Oct 27, 2023 · 4 comments
Open

HTTPError: Response code 502 (Bad Gateway) #3032

yeelimtse opened this issue Oct 27, 2023 · 4 comments

Comments

@yeelimtse
Copy link

Current behavior

In the first release, it successfully analyzed all the commits but it threw a 502 at the end.

Expected behavior

semantic-release passes w/o err.

semantic-release version

22.0.5

CI environment

gitlab-runner 15.4.0, node image: 18.17.1

Plugins used

plugins:
  - '@semantic-release/commit-analyzer'
  - '@semantic-release/changelog'
  - '@semantic-release/gitlab'
  - '@semantic-release/release-notes-generator'

Installed wi npx:

npx --package @semantic-release/changelog@6.0.3 \
    --package @semantic-release/commit-analyzer@11.0.0 \
    --package @semantic-release/gitlab@12.0.6 \
    --package @semantic-release/release-notes-generator@12.0.0 \
    --package conventional-changelog-conventionalcommits@7.0.2 \
    --package semantic-release@22.0.5 \
    semantic-release --tag-format '${version}'+"$(date +'%Y-%m-%d')"

semantic-release configuration

.releaserc.yml

branches: ['master']
ci: true
debug: true
dryRun: false
tagFormat: '${version}'

plugins:
  - '@semantic-release/commit-analyzer'
  - '@semantic-release/changelog'
  - '@semantic-release/gitlab'
  - '@semantic-release/release-notes-generator'

preset: 'conventionalcommits'

verifyConditions:
  - '@semantic-release/changelog'
  - '@semantic-release/gitlab'

analyzeCommits:
  - path: '@semantic-release/commit-analyzer'
    releaseRules:
      - type: breaking # Changes that break something makes something incompatible to ealier version
        release: major
      - type: build # Changes that affect the build system or external dependencies
        release: patch
      - type: chore # Other changes that don't modify src or test files
        release: false
      - type: ci # Changes to our CI configuration files and scripts
        release: false
      - type: docs # Documentation only changes
        release: false
      - type: feat # A new feature
        release: minor
      - type: fix # A bug fix
        release: patch
      - type: perf # A code change that improves performance
        release: patch
      - type: refactor # A code change that neither fixes a bug nor adds a feature
        release: false
      - type: revert # Reverts a previous commit
        release: patch
      - type: style # Changes that do not affect the meaning of the code
        release: false
      - type: test # Adding missing tests or correcting existing tests
        release: false

generateNotes:
  - path: '@semantic-release/release-notes-generator'
    writerOpts:
      groupBy: 'type'
      commitGroupsSort: 'title'
      commitsSort: 'header'
    linkCompare: true
    linkReferences: true
    presetConfig:
      types: # looks like it only works with 'conventionalcommits' preset
        - type: 'breaking'
          section: '🧨 Breaking changes!'
          hidden: false
        - type: 'build'
          section: '🦊 CI/CD'
          hidden: false
        - type: 'chore'
          section: 'Other'
          hidden: false
        - type: 'ci'
          section: '🦊 CI/CD'
          hidden: false
        - type: 'docs'
          section: '📔 Docs'
          hidden: false
        - type: 'example'
          section: '📝 Examples'
          hidden: false
        - type: 'feat'
          section: '🚀 Features'
          hidden: false
        - type: 'fix'
          section: '🛠 Fixes'
          hidden: false
        - type: 'perf'
          section: '⏩ Performance'
          hidden: false
        - type: 'refactor'
          section: ':scissors: Refactor'
          hidden: false
        - type: 'revert'
          section: '👀 Reverts'
          hidden: false
        - type: 'style'
          section: '💈 Style'
          hidden: false
        - type: 'test'
          section: '🧪 Tests'
          hidden: false

prepare:
  - path: '@semantic-release/changelog'

CI logs

[8:39:03 PM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[8:39:03 PM] [semantic-release] › ℹ  There is no previous release, the next release version is 1.0.0
[8:39:03 PM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[8:39:05 PM] [semantic-release] › ✔  Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[8:39:05 PM] [semantic-release] › ℹ  Start step "prepare" of plugin "@semantic-release/changelog"
[8:39:05 PM] [semantic-release] [@semantic-release/changelog] › ℹ  Create /builds/development/application/my-project/CHANGELOG.md
[8:39:05 PM] [semantic-release] › ✔  Completed step "prepare" of plugin "@semantic-release/changelog"
[8:39:06 PM] [semantic-release] › ✔  Created tag 1.0.0+2023-10-27
[8:39:06 PM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/gitlab"
[8:39:07 PM] [semantic-release] [@semantic-release/gitlab] › ℹ  Published GitLab release: 1.0.0+2023-10-27
[8:39:07 PM] [semantic-release] › ✔  Completed step "publish" of plugin "@semantic-release/gitlab"
[8:39:07 PM] [semantic-release] › ℹ  Start step "success" of plugin "@semantic-release/gitlab"
[8:39:22 PM] [semantic-release] [@semantic-release/gitlab] › ✘  An error occurred while posting comments to related issues and merge requests:
HTTPError: Response code 502 (Bad Gateway)
    at Request.<anonymous> (file:///root/.npm/_npx/e1ba7bb3a25d9829/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:629:26)
    at Request.emit (node:events:526:35)
    at Request._onResponseBase (file:///root/.npm/_npx/e1ba7bb3a25d9829/node_modules/got/dist/source/core/index.js:726:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///root/.npm/_npx/e1ba7bb3a25d9829/node_modules/got/dist/source/core/index.js:768:13) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
...
@maheshglm
Copy link

@yeelimtse Hi, did you able to solve this issue ? I am seeing 502 error during release all of sudden today

@yeelimtse
Copy link
Author

@maheshglm no, have no idea why

@maheshglm
Copy link

I could resolve the issue in my case, it was due to existing npm project’s package.json , dist and node_modules folders. I tried to run semantic-release excluding them and it was working finally.

@yeelimtse
Copy link
Author

weird, i dont think it's necessary to remove package.json tho? cuz whenever we want to roll back to previous releases/versions, we also want to use the old dependencies which are compatible with that specific version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants