Skip to content

Version Command failed Create Release step under Github Enterprise VCS #895

Closed
@xesf

Description

@xesf

The problem

Semantic Release is not able to Create a Release in Github during version command.

I am trying to migrate my setup from version 7 to 9 and re-configuring from setup.cfg file to pyproject.toml

The previous single publish command no longer works due to breaking changes on v9 and the new version is partially working.
The new version is identified, changelog is updated, commits and tags pushed to github, but at the last stage semantic release is not able to create a release under github release options.

Expected behavior

Be able to create a release in VCS Github.

Environment

Running in a private Github Action Runners via command line:

python3.11 -m semantic_release version (failed command)

GHA workflow:

- name: Publish Semantic Version and Generate Changelog
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          python3.11 -m semantic_release version

python 3.11
semantic release 9.4.2
via pip

Configuration

[tool.semantic_release]
branch = "main"
changelog_file = "CHANGELOG.md"
commit_message = "chore(release): release version {version} [ci skip]"
version_variables = [
    "src/artifacts/__init__.py:__version__"
]
upload_to_vcs_release = false
remote.type = "github"
remote.domain = "git-domain.com"
remote.api_domain = "git-domain.com/api/v3"

Logs

python3.11 -m semantic_release version
0.1.7
The next version is: 0.1.7! 🚀
No build command specified, skipping
[13:27:25] ERROR    [semantic_release.cli.commands.version] ERROR version.py:642
                    version.version: Unreadable json response                   
                    ╭──── Traceback (most recent call last) ────╮               
                    │ /home/runner/.local/lib/python3.11/site-p │               
                    │ ackages/requests/models.py:971 in json    │               
                    │                                           │               
                    │    968 │   │   │   │   │   raise Requests │               
                    │    969 │   │                              │               
                    │    970 │   │   try:                       │               
                    │ ❱  971 │   │   │   return complexjson.loa │               
                    │    972 │   │   except JSONDecodeError as  │               
                    │    973 │   │   │   # Catch JSON-related e │               
                    │    974 │   │   │   # This aliases json.JS │               
                    │                                           │               
                    │ /usr/lib/python3.11/json/__init__.py:346  │               
                    │ in loads                                  │               
                    │                                           │               
                    │   343 │   if (cls is None and object_hook │               
                    │   344 │   │   │   parse_int is None and p │               
                    │   345 │   │   │   parse_constant is None  │               
                    │ ❱ 346 │   │   return _default_decoder.dec │               
                    │   347 │   if cls is None:                 │               
                    │   348 │   │   cls = JSONDecoder           │               
                    │   349 │   if object_hook is not None:     │               
                    │                                           │               
                    │ /usr/lib/python3.11/json/decoder.py:337   │               
                    │ in decode                                 │               
                    │                                           │               
                    │   334 │   │   containing a JSON document) │               
                    │   335 │   │                               │               
                    │   336 │   │   """
                    │ ❱ 337 │   │   obj, end = self.raw_decode( │               
                    │   338 │   │   end = _w(s, end).end()      │               
                    │   339 │   │   if end != len(s):           │               
                    │   340 │   │   │   raise JSONDecodeError(" │               
                    │                                           │               
                    │ /usr/lib/python3.11/json/decoder.py:355   │               
                    │ in raw_decode                             │               
                    │                                           │               
                    │   352 │   │   try:                        │               
                    │   353 │   │   │   obj, end = self.scan_on │               
                    │   354 │   │   except StopIteration as err │               
                    │ ❱ 355 │   │   │   raise JSONDecodeError("
                    │   356 │   │   return obj, end             │               
                    │   357                                     │               
                    ╰───────────────────────────────────────────╯               
                    JSONDecodeError: Expecting value: line 7                    
                    column 1 (char 6)                                           
                                                                                
                    During handling of the above exception,                     
                    another exception occurred:                                 
                                                                                
                    ╭──── Traceback (most recent call last) ────╮               
                    │ /home/runner/.local/lib/python3.11/site-p │               
                    │ ackages/semantic_release/hvcs/github.py:2 │               
                    │ 03 in create_release                      │               
                    │                                           │               
                    │   [20]()0 │   │   response.raise_for_status() │               
                    │   201 │   │                               │               
                    │   202 │   │   try:                        │               
                    │ ❱ 203 │   │   │   release_id: int = respo │               
                    │   204 │   │   │   log.info("Successfully  │               
                    │   205 │   │   │   return release_id       │               
                    │   206 │   │   except JSONDecodeError as e │               
                    │                                           │               
                    │ /home/runner/.local/lib/python3.11/site-p │               
                    │ ackages/requests/models.py:975 in json    │               
                    │                                           │               
                    │    972 │   │   except JSONDecodeError as  │               
                    │    973 │   │   │   # Catch JSON-related e │               
                    │    974 │   │   │   # This aliases json.JS │               
                    │ ❱  975 │   │   │   raise RequestsJSONDeco │               
                    │    976 │                                  │               
                    │    977 │   @property                      │               
                    │    978 │   def links(self):               │               
                    ╰───────────────────────────────────────────╯               
                    JSONDecodeError: Expecting value: line 7                    
                    column 1 (char 6)                                           
                                                                                
                    The above exception was the direct cause of                 
                    the following exception:                                    
                                                                                
                    ╭──── Traceback (most recent call last) ────╮               
                    │ /home/runner/.local/lib/python3.11/site-p │               
                    │ ackages/semantic_release/cli/commands/ver │               
                    │ sion.py:633 in version                    │               
                    │                                           │               
                    │   630 │   │   │   noop_report(f"would hav │               
                    │   631 │   │   else:                       │               
                    │   632 │   │   │   try:                    │               
                    │ ❱ 633 │   │   │   │   release_id = hvcs_c │               
                    │   634 │   │   │   │   │   tag=new_version │               
                    │   635 │   │   │   │   │   release_notes=r │               
                    │   636 │   │   │   │   │   prerelease=new_ │               
                    │                                           │               
                    │ /home/runner/.local/lib/python3.11/site-p │               
                    │ ackages/semantic_release/helpers.py:53 in │               
                    │ _wrapper                                  │               
                    │                                           │               
                    │    50 │   │   │   )                       │               
                    │    51 │   │   │                           │               
                    │    52 │   │   │   # Call function         │               
                    │ ❱  53 │   │   │   result = func(*args, ** │               
                    │    54 │   │   │                           │               
                    │    55 │   │   │   # Log result            │               
                    │    56 │   │   │   logger.debug("%s -> %s"
                    │                                           │               
                    │ /home/runner/.local/lib/python3.11/site-p │               
                    │ ackages/semantic_release/hvcs/github.py:2 │               
                    │ 72 in create_or_update_release            │               
                    │                                           │               
                    │   269 │   │   """                         │               
                    │   270 │   │   log.info("Creating release  │               
                    │   271 │   │   try:                        │               
                    │ ❱ 272 │   │   │   return self.create_rele │               
                    │   273 │   │   except HTTPError as err:    │               
                    │   274 │   │   │   log.debug("error creati │               
                    │   275 │   │   │   log.debug("looking for  │               
                    │                                           │               
                    │ /home/runner/.local/lib/python3.11/site-p │               
                    │ ackages/semantic_release/helpers.py:53 in │               
                    │ _wrapper                                  │               
                    │                                           │               
                    │    50 │   │   │   )                       │               
                    │    51 │   │   │                           │               
                    │    52 │   │   │   # Call function         │               
                    │ ❱  53 │   │   │   result = func(*args, ** │               
                    │    54 │   │   │                           │               
                    │    55 │   │   │   # Log result            │               
                    │    56 │   │   │   logger.debug("%s -> %s"
                    │                                           │               
                    │ /home/runner/.local/lib/python3.11/site-p │               
                    │ ackages/semantic_release/hvcs/github.py:2 │               
                    │ 07 in create_release                      │               
                    │                                           │               
                    │   204 │   │   │   log.info("Successfully  │               
                    │   205 │   │   │   return release_id       │               
                    │   206 │   │   except JSONDecodeError as e │               
                    │ ❱ 207 │   │   │   raise UnexpectedRespons │               
                    ���   208 │   │   except KeyError as err:     │               
                    │   209 │   │   │   raise UnexpectedRespons │               
                    │   [21]()0                                     │               
                    ╰───────────────────────────────────────────╯               
                    UnexpectedResponse: Unreadable json response                
Usage: python -m semantic_release version [OPTIONS]
Try 'python -m semantic_release version -h' for help.

Error: Unreadable json response
Unexpected response from remote VCS!
Before re-running, make sure to clean up any artifacts on the hvcs that may have already been created.

Additional context

  • Private Github Enterprise version 3.11.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working properlyreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions