Build error cannot find module providing package github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile

This issue has been created since 2022-05-19.

I try to build my module https://github.com/git001/caddyv2-upload which was possible with 2.5.0 nowadays I get the following errors.

2022/05/19 12:52:14 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2 
github.com/caddyserver/caddy/v2 imports
	github.com/caddyserver/caddy/v2/caddyconfig/caddyfile: cannot find module providing package github.com/caddyserver/caddy/v2/caddyconfig/caddyfile
github.com/caddyserver/caddy/v2 imports
	github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile: cannot find module providing package github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile
github.com/caddyserver/caddy/v2 imports
	github.com/caddyserver/caddy/v2/modules/caddyhttp: cannot find module providing package github.com/caddyserver/caddy/v2/modules/caddyhttp
2022/05/19 12:52:14 [FATAL] exit status 1

My golang version

go version
go version go1.18.1 linux/amd64

As this is my first caddy module I'm quite sure that I do something wrong, please can you help me to fix the issue.
Here is the full build output.

Mai 19 at 12:50:41 /datadisk/git-repos/caddyv2-upload # ~/Downloads/xcaddy/xcaddy_0.3.0/xcaddy build --with github.com/caddyserver/jsonc-adapter --with github.com/caddyserver/caddy/v2=.
2022/05/19 12:52:14 [INFO] Resolved relative replacement github.com/caddyserver/caddy/v2=. to /datadisk/git-repos/caddyv2-upload
2022/05/19 12:52:14 [INFO] Temporary folder: /tmp/buildenv_2022-05-19-1252.3116395694
2022/05/19 12:52:14 [INFO] Writing main module: /tmp/buildenv_2022-05-19-1252.3116395694/main.go
package main

import (
	caddycmd "github.com/caddyserver/caddy/v2/cmd"

	// plug in Caddy modules here
	_ "github.com/caddyserver/caddy/v2/modules/standard"
	_ "github.com/caddyserver/jsonc-adapter"
	_ "github.com/caddyserver/caddy/v2"
)

func main() {
	caddycmd.Main()
}
2022/05/19 12:52:14 [INFO] Initializing Go module
2022/05/19 12:52:14 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init caddy 
go: creating new go.mod: module caddy
go: to add module requirements and sums:
	go mod tidy
2022/05/19 12:52:14 [INFO] Replace github.com/caddyserver/caddy/v2 => /datadisk/git-repos/caddyv2-upload
2022/05/19 12:52:14 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod edit -replace github.com/caddyserver/caddy/v2=/datadisk/git-repos/caddyv2-upload 
2022/05/19 12:52:14 [INFO] Pinning versions
2022/05/19 12:52:14 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2 
github.com/caddyserver/caddy/v2 imports
	github.com/caddyserver/caddy/v2/caddyconfig/caddyfile: cannot find module providing package github.com/caddyserver/caddy/v2/caddyconfig/caddyfile
github.com/caddyserver/caddy/v2 imports
	github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile: cannot find module providing package github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile
github.com/caddyserver/caddy/v2 imports
	github.com/caddyserver/caddy/v2/modules/caddyhttp: cannot find module providing package github.com/caddyserver/caddy/v2/modules/caddyhttp
2022/05/19 12:52:14 [FATAL] exit status 1

francislavoie wrote this answer on 2022-05-19

Please post the actual command you're running. We can't confirm unless we see the xcaddy build command.

francislavoie wrote this answer on 2022-05-19

--with github.com/caddyserver/caddy/v2=.

This reads to me like you're trying to replace Caddy itself with your plugin. That doesn't make sense. I think you wanted to do --with github.com/git001/caddyv2-upload=.

git001 wrote this answer on 2022-05-19

Please post the actual command you're running. We can't confirm unless we see the xcaddy build command.

Ups formating issue.

Here the full cmd. I have also fixed the formatting issue in the first message.

~/Downloads/xcaddy/xcaddy_0.3.0/xcaddy build --with github.com/caddyserver/jsonc-adapter --with github.com/caddyserver/caddy/v2=.

git001 wrote this answer on 2022-05-19

This reads to me like you're trying to replace Caddy itself with your plugin. That doesn't make sense. I think you wanted to do --with github.com/git001/caddyv2-upload=.

Thanks.
This was the build command for the PR caddyserver/caddy#4767 which definitely makes no sense for the module. 🤦‍♂️

Sorry for the noise 😞

More Details About Repo
Owner Name caddyserver
Repo Name xcaddy
Full Name caddyserver/xcaddy
Language Go
Created Date 2020-03-21
Updated Date 2022-09-22
Star Count 381
Watcher Count 14
Fork Count 72
Issue Count 3

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
How does keplr broadcast transactions? 2 2022-04-16 2022-08-01
Allow using custom coin types in derivative path 0 2022-04-20 2022-08-18
The dataset splitting method 3 2021-06-18 2022-07-22
There is a mismatch between COVID-CTset.zip and Train&Validation.zip. 2 2021-01-26 2022-07-15
I have written a Python SDK for this project 0 2021-11-13 2022-09-13
Migrations can't be run on multiple schemas in the same database 1 2022-07-13 2022-07-17
Microsoft button itself not able to see in the UI 1 2022-04-11 2022-09-27
Negative weight or height should not be allowed 5 2021-08-24 2022-09-27
Controller setup gone wrong 1 2021-01-14 2022-07-21
How ofter maps are updated? 2 2022-04-11 2022-07-17
v1.15より、複数画面時にウマ娘のウィンドウを認識しない場合がある 3 2021-10-10 2022-09-27
internal/informers error 1 2020-11-24 2022-07-28
Can't configure button in citrix vdi virtual machine 0 2022-05-17 2022-09-03
Use Unique Local Variables in script.js 1 2021-01-23 2022-09-15
deselect Functionality tab outside of dropdown 0 2021-11-23 2022-08-25
[email protected]: hash check failed 1 2022-09-25 2022-09-21
Crash when switching locations 1 2021-07-23 2022-09-11
🔥 connect/connect-aws-lambda-sink 18 2022-04-27 2022-05-30
🔥 connect/connect-azure-cognitive-search-sink 1 2022-07-15 2022-09-04
Pre-existing categories are not present in Cache 5 2021-09-20 2022-08-01
how to run my lua file 3 2021-07-08 2022-08-31
RequestManager Assumes JSON Body 2 2021-12-10 2022-09-11
[footer]: adjust the layout on mobile. 0 2021-10-11 2022-09-27
Which version of MPM code to use? 2 2022-07-01 2022-09-26
origin CNAME and other RR check 1 2021-03-15 2022-09-06
Failed to inject frida-agent into launchd(pid 1) on iOS 14.5 jailbroken with Checkra1n 0.12.3 13 2021-05-03 2022-09-07
support poi 4.0 7 2018-10-01 2021-12-31
[Accessibility] [Microsoft Graph Toolkit Playground]: Navigation LM is getting disappear when zoom is set to 400%. [Sev2][WCAG1.4.10] 2 2022-02-16 2022-09-27
[Accessibility] [Microsoft Graph Toolkit Playground]: Few controls are not visible when zoom is set to 200%[Sev2][WCAG1.4.4] 3 2022-02-16 2022-09-27
Autocorrect (idea) 2 2021-10-19 2021-12-30
[en] Its->it's false positive 1 2021-10-20 2022-07-15
[en] "early" missing JJ tag 2 2021-10-20 2022-08-18
Pull Radarr commit 'Fixed: Time column is first column on events page [common]' 0 2021-10-24 2022-09-24
Add support for `opentelemetry` 0 2021-11-29 2022-07-15
Wrong warning TF_REPEATED_DATA if 2 different transforms (with different frames) but same timestamp 0 2022-06-09 2022-09-05
Saved addresses list needs adjustments to look like designs 0 2022-07-17 2022-09-13
Weird boundingobject(collision) on the ElevationGrid 2 2022-01-29 2022-08-21
truncate decimal crash in branch-2.2 asan (pipeline off) 3 2022-03-19 2022-09-11
Bump lodash from 4.17.15 to 4.17.19 2 2020-07-16 2022-01-30
html.global_attributes.translate - <https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/translate> 0 2022-01-12 2022-09-27
chunksDirectory and rulesDirectory variable name is error! 11 2022-05-26 2022-09-28
Expandable Menus close before being able to click 1 2021-10-05 2022-09-14
错字 Liner Regression 少了个a 0 2021-08-05 2022-09-27
Implement `Clone` for `WeakRecipient` 0 2022-01-02 2022-09-13
Incorrect imports in generated service files for Python 0 2021-01-25 2022-08-27
ModuleNotFoundError: No module named 'flask._compat' 1 2021-07-18 2022-09-19
Scripting or tracing ? 1 2021-03-02 2022-09-15
Add support for vararg options 1 2022-07-17 2022-09-12
chore: bump postcss from 7.0.35 to 7.0.36 in /dev4 1 2021-06-15 2022-09-27
Error when running example script `pytorch_spark_mnist.py` 1 2021-12-01 2022-08-07