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

Add project-name arg to ddev logs, perhaps other commands that are missing it. #3203

Closed
chellman opened this issue Aug 26, 2021 · 3 comments
Closed

Comments

@chellman
Copy link
Contributor

Describe the bug

Restoring a large database, I got this message:

You can also follow the restore progress in another terminal window with ddev logs -s db -f project-name

So I tried opening a fresh terminal window and running that command, and got this:

Failed to retrieve logs: Could not find a project in /Users/chellman. Have you run 'ddev config'? Please specify a project name or change directories: no .ddev/config.yaml file was found in this directory or any parent

So basically it looks like the logs command doesn't see the project name argument.

To Reproduce

Easiest way to do this would be to change directories to anywhere that isn't a ddev project, then run this:

ddev logs <project-name>

Expected behavior

I would expect the web service log for that project. Instead ddev tells me no project exists.

Version and configuration information (please complete the following information):

  • Host computer OS and Version: macOS Catalina
  • Docker Desktop version: 3.6
  • ddev version: v1.18.0-alpha3
  • Do you have any custom configuration (nginx, php, mysql) in the .ddev folder? No.
@rfay
Copy link
Member

rfay commented Aug 26, 2021

ddev logs -h doesn't suggest that the projectname option is available (although it would be nice). Sounds like the error message is just wrong?

$ ddev logs -h
Uses 'docker logs' to display stdout from the running services.

Usage:
  ddev logs [flags]

Examples:
ddev logs
ddev logs -f
ddev logs -s db

Flags:
  -f, --follow           Follow the logs in real time.
  -h, --help             help for logs
  -s, --service string   Defines the service to retrieve logs from. [e.g. web, db] (default "web")
      --tail string      How many lines to show
  -t, --time             Add timestamps to logs

@chellman
Copy link
Contributor Author

Yeah, seems like either the feedback message on the snapshot restore command should be updated so you know you have to be in the project directory for it to work, or the logs command needs to be updated so it can use a passed project name. I don't particularly care one way or the other, just wanted to bring it up. If it just updating the message, I can send a PR. The other requires Go skills I don't currently have.

@rfay
Copy link
Member

rfay commented Aug 26, 2021

Actually it's just copy-pasta, sadly. You could look at any of the commands that support it and you'd be able to add it in no time :). I think it would be better to actually add it for consistency. Sadly, I think there are a couple of others that ought to take project name and don't.

@rfay rfay changed the title Logs command doesn't seem to accept project name argument Add project-name arg to ddev logs, perhaps other commands that are missing it. Aug 27, 2021
chellman added a commit to chellman/ddev that referenced this issue Aug 30, 2021
@rfay rfay closed this as completed in 5775ebb Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants