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

No services were found in the compose document(s). Did you mean to use profiles instead? #4264

Closed
arisliang opened this issue Mar 19, 2024 · 11 comments

Comments

@arisliang
Copy link

image

When right click on the docker-compose.yml file, and select 'Compose up - selected services', no service is found, even though there are services in the file, and 'Compose Up' is able to run all of them.

vscode: v1.87.2
docker extension: v1.29.0
Docker version 24.0.5, build ced0996

@bwateratmsft
Copy link
Contributor

Can you share your compose document?

@arisliang
Copy link
Author

arisliang commented Mar 20, 2024

don't think it's related to particular compose file. Same compose file works on another machine. And it seems any compose file would be the same on this machine. I created a minimal compose, it gives this error.

version: '3'
services:
  hello1:
    image: hello-world

  hello2:
    image: hello-world

More vscode info:

Version: 1.87.2
Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
Date: 2024-03-08T15:14:59.643Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 6.5.0-26-generic snap

it's newly installed ubuntu 22.04. Never happend like this previously.

@bwateratmsft
Copy link
Contributor

Do you have a non-default value for the setting docker.commands.composeUp or docker.commands.composeUpSubset? We use a docker-compose config --services to find the list of services, it's this config command that appears to be failing to find any services.

@arisliang
Copy link
Author

arisliang commented Mar 25, 2024

I didn't change the default setting. I check in defaultSettings.json, for the 2 setting, it's:

	// Command templates for `docker-compose up` commands.
	"docker.commands.composeUp": [
		{
			"label": "Compose Up",
			"template": "${composeCommand} ${configurationFile} up ${detached} ${build}"
		}
	],

	// Command templates for `docker-compose up <subset>` commands.
	"docker.commands.composeUpSubset": [
		{
			"label": "Compose Up",
			"template": "${composeCommand} ${profileList} ${configurationFile} up ${detached} ${build} ${serviceList}"
		}
	],

docker.commands.composeUpSubset seems to expect profile list, what's that?

Removed the ${profileList} bit and add it to user setting, still the same error

@bwateratmsft
Copy link
Contributor

The profile list is for when you're using compose profiles instead of service subsets. When they aren't in use, we substitute in an empty string, and vice versa with ${serviceList} when they are in use.

Can you run docker compose config --services and see what the output is?

@arisliang
Copy link
Author

looks like the output is fine.

$ docker compose -f docker-compose-hello.yml config --services
hello1
hello2

@bwateratmsft
Copy link
Contributor

This could be a Snap issue. Can you try the workaround in #3843 (comment) and see if that fixes it?

@arisliang
Copy link
Author

set Docker Path, it doesn't seem to help. Restarting code doesn't help either.

Screenshot from 2024-04-05 11-24-15

@bwateratmsft
Copy link
Contributor

This is a tough one. The call to docker compose config --services is succeeding, else a different error would be raised. However it is returning zero services when run. The only thing I can think to try is to run docker-compose -f docker-compose-hello.yml config --services--note the dash inbetween docker-compose, this is the old compose command. The system is supposed to autodetect that docker compose is available and use it, but there could be a bug in that logic.

@AzCode-Bot
Copy link
Collaborator

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@AzCode-Bot AzCode-Bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2024
@arisliang
Copy link
Author

FYI, after switch to deb installation, the issue is gone.

@microsoft microsoft locked and limited conversation to collaborators Jun 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants