# Failed to upgrade sub modules when the tagged version is same as the main module

**URL:** <https://discourse.gohugo.io/t/failed-to-upgrade-sub-modules-when-the-tagged-version-is-same-as-the-main-module/43496>\
**Category:** support\
**Tags:** modules\
**Created:** [March 17, 2023, 7:20pm UTC](https://discourse.gohugo.io/t/failed-to-upgrade-sub-modules-when-the-tagged-version-is-same-as-the-main-module/43496 "2023-03-17T19:20:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![razon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/razon/32/14882_2.png) [@razon](https://discourse.gohugo.io/u/razon)\
**Post date:** [March 17, 2023, 7:20pm UTC](https://discourse.gohugo.io/t/failed-to-upgrade-sub-modules-when-the-tagged-version-is-same-as-the-main-module/43496/1 "2023-03-17T19:20:38Z")

</div>

This issue comes up several times.

I got two modules that tagged as same `version`.

| Module | Version |
| --- | --- |
| `hb` | `v0.1.2` |
| `hb/modules/meta/docs` | `v0.1.2` |

> The `hb@v0.1.2` is released earlier than `hb/modules/meta/docs@v0.1.2`, which doesn’t include the `docs` submodule.

I got the following error when I try to upgrade to `hb/modules/meta/docs@v0.1.2`.

```sh
➜ hugo mod get -u github.com/razonyang/hb/modules/meta/docs@v0.1.2
go: module github.com/razonyang/hb@v0.1.2 found, but does not contain package github.com/razonyang/hb/modules/meta/docs
Error: failed to get ["-d" "-u" "github.com/razonyang/hb/modules/meta/docs@v0.1.2"]: 
failed to execute 'go [get -d -u github.com/razonyang/hb/modules/meta/docs@v0.1.2]': 
failed to execute binary "go" with args [get -d -u github.com/razonyang/hb/modules/meta/docs@v0.1.2]: go: module github.com/razonyang/hb@v0.1.2 found, 
but does not contain package github.com/razonyang/hb/modules/meta/docs
 *errors.errorString

➜ hugo mod get github.com/razonyang/hb/modules/meta/docs@v0.1.2 
go: module github.com/razonyang/hb@v0.1.2 found, but does not contain package github.com/razonyang/hb/modules/meta/docs
Error: failed to get ["-d" "github.com/razonyang/hb/modules/meta/docs@v0.1.2"]: 
failed to execute 'go [get -d github.com/razonyang/hb/modules/meta/docs@v0.1.2]': 
failed to execute binary "go" with args [get -d github.com/razonyang/hb/modules/meta/docs@v0.1.2]: go: module github.com/razonyang/hb@v0.1.2 found, 
but does not contain package github.com/razonyang/hb/modules/meta/docs
 *errors.errorString

```

But it’s strange that everything works fine after running `go get`.

```sh
➜ go get -u github.com/razonyang/hb/modules/meta/docs@v0.1.2
go: downloading github.com/razonyang/hb v0.1.2
go: downloading github.com/razonyang/hb/modules/meta/docs v0.1.2
go: upgraded github.com/razonyang/hb/modules/meta/docs v0.1.1 => v0.1.2

➜ hugo mod get -u github.com/razonyang/hb/modules/meta/docs@v0.1.2

➜ hugo mod tidy

➜ git diff | grep docs
- github.com/razonyang/hb/modules/meta/docs v0.1.1 // indirect
+ github.com/razonyang/hb/modules/meta/docs v0.1.2 // indirect

```
