[GODRIVER-1095] Cannot install latest version of mongodb client driver Created: 29/May/19  Updated: 31/May/19  Resolved: 31/May/19

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jean-Marcel Belmont Assignee: Emmanuel Eppinger (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I have been trying to install mongodb golang driver with dep and I have copied a verbose output showing how version 0.3.0 is picked up instead:

 

dep init -v
Getting direct dependencies...
Checked 3243 directories for packages.
Found 1 direct dependencies.
Root project is "github.com/jbelmont/nosql-workshop"
1 transitively valid internal packages
2 external packages imported from 1 projects
(0) ✓ select (root)
(1) ? attempt github.com/mongodb/mongo-go-driver with 2 pkgs; 41 versions to try
(1) try github.com/mongodb/mongo-go-driver@v1.0.2
(2) ✗ github.com/mongodb/mongo-go-driver at v1.0.2 has problem subpkg(s):
(2) github.com/mongodb/mongo-go-driver/mongo has err (*pkgtree.NonCanonicalImportRoot); required by (root). github.com/mongodb/mongo-go-driver/mongo/options has err (*pkgtree.NonCanonicalImportRoot); required by (root).
(1) try github.com/mongodb/mongo-go-driver@v1.0.1
(2) ✗ github.com/mongodb/mongo-go-driver at v1.0.1 has problem subpkg(s):
(2) github.com/mongodb/mongo-go-driver/mongo has err (*pkgtree.NonCanonicalImportRoot); required by (root). github.com/mongodb/mongo-go-driver/mongo/options has err (*pkgtree.NonCanonicalImportRoot); required by (root).
(1) try github.com/mongodb/mongo-go-driver@v1.0.0
(2) ✗ github.com/mongodb/mongo-go-driver at v1.0.0 has problem subpkg(s):
(2) github.com/mongodb/mongo-go-driver/mongo has err (*pkgtree.NonCanonicalImportRoot); required by (root). github.com/mongodb/mongo-go-driver/mongo/options has err (*pkgtree.NonCanonicalImportRoot); required by (root).
(1) try github.com/mongodb/mongo-go-driver@v0.3.0
(1) ✓ select github.com/mongodb/mongo-go-driver@v0.3.0 w/30 pkgs
(2) ? attempt github.com/xdg/scram with 1 pkgs; 1 versions to try
(2) try github.com/xdg/scram@master
(2) ✓ select github.com/xdg/scram@master w/1 pkgs
(3) ? attempt golang.org/x/sync with 1 pkgs; 1 versions to try
(3) try golang.org/x/sync@master
(3) ✓ select golang.org/x/sync@master w/1 pkgs
(4) ? attempt github.com/golang/snappy with 1 pkgs; 3 versions to try
(4) try github.com/golang/snappy@v0.0.1
(5) ✗ github.com/golang/snappy@v0.0.1 not allowed by constraint master:
(5) master from github.com/mongodb/mongo-go-driver@v0.3.0
(4) try github.com/golang/snappy@master
(4) ✓ select github.com/golang/snappy@master w/1 pkgs
(5) ? attempt github.com/go-stack/stack with 1 pkgs; 16 versions to try
(5) try github.com/go-stack/stack@v1.8.0
(5) ✓ select github.com/go-stack/stack@v1.8.0 w/1 pkgs
(6) ? attempt github.com/xdg/stringprep with 1 pkgs; 2 versions to try
(6) try github.com/xdg/stringprep@v1.0.0
(7) ✗ github.com/xdg/stringprep@v1.0.0 not allowed by constraint master:
(7) master from github.com/mongodb/mongo-go-driver@v0.3.0
(6) try github.com/xdg/stringprep@master
(6) ✓ select github.com/xdg/stringprep@master w/1 pkgs
(7) ? attempt golang.org/x/crypto with 1 pkgs; 3 versions to try
(7) try golang.org/x/crypto@master
(7) ✓ select golang.org/x/crypto@master w/1 pkgs
(8) ? attempt golang.org/x/text with 1 pkgs; 8 versions to try
(8) try golang.org/x/text@v0.3.2
(8) ✓ select golang.org/x/text@v0.3.2 w/6 pkgs
✓ found solution with 42 packages from 8 projects

Solver wall times by segment:
b-list-versions: 5.144716964s
b-list-pkgs: 2.983486846s
b-gmal: 1.537730139s
b-deduce-proj-root: 849.161524ms
b-source-exists: 575.297638ms
select-root: 10.791067ms
select-atom: 5.795784ms
satisfy: 4.85848ms
new-atom: 309.192µs
other: 56.091µs

TOTAL: 11.112203725s

Locking in master (1122301) for transitive dep golang.org/x/sync
Locking in master (2a8bb92) for transitive dep github.com/golang/snappy
Locking in v1.8.0 (2fee6af) for transitive dep github.com/go-stack/stack
Locking in master (73f8eec) for transitive dep github.com/xdg/stringprep
Locking in master (22d7a77) for transitive dep golang.org/x/crypto
Locking in v0.3.2 (342b2e1) for transitive dep golang.org/x/text
Using ^0.3.0 as constraint for direct dep github.com/mongodb/mongo-go-driver
Locking in v0.3.0 (e1f3d10) for direct dep github.com/mongodb/mongo-go-driver
Locking in master (7eeb566) for transitive dep github.com/xdg/scram
(1/8) Wrote github.com/xdg/stringprep@master
(2/8) Wrote golang.org/x/sync@master
(3/8) Wrote github.com/go-stack/stack@v1.8.0
(4/8) Wrote github.com/xdg/scram@master
(5/8) Wrote github.com/golang/snappy@master
(6/8) Wrote golang.org/x/crypto@master
(7/8) Wrote golang.org/x/text@v0.3.2
(8/8) Wrote github.com/mongodb/mongo-go-driver@v0.3.0

 

I should be able to get the latest version.



 Comments   
Comment by Jean-Marcel Belmont [ 31/May/19 ]

Thank you, yes the problem was the github paths in my case once I used the go.mongodb.com paths everything got pulled in correctly!

Comment by Emmanuel Eppinger (Inactive) [ 31/May/19 ]

marcelbelmont@gmail.com 

Can you ensure that all of your imports are using the go.mongodb.com paths instead of the github.com paths:

import (
    "go.mongodb.org/mongo-driver/mongo"
    "go.mongodb.org/mongo-driver/mongo/options"  
    "etcetera"

Using the github.com paths gave me issues when I tried them initializing them when using dep.

 

Thanks,

Emmanuel

 

Generated at Thu Feb 08 08:35:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.