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

"Need to give this composition a project name" (lando init) #3672

Open
ccharlton opened this issue Feb 21, 2024 · 10 comments
Open

"Need to give this composition a project name" (lando init) #3672

ccharlton opened this issue Feb 21, 2024 · 10 comments
Assignees
Labels
bug Something aint working right!

Comments

@ccharlton
Copy link
Contributor

Got this error when starting a new Lando app (v3.21.0-beta.1). I couldn't find that string in the source code. What causes it?

"Need to give this composition a project name"

@ccharlton ccharlton added the bug Something aint working right! label Feb 21, 2024
@reynoldsalec
Copy link
Sponsor Member

@ccharlton when do you see that message? Would be good to know source/recipe selections you make if you get that far in the lando init process; I'm not able to replicate running lando init and choosing the local working directory/LAMP recipe.

@reynoldsalec reynoldsalec self-assigned this Feb 21, 2024
@ccharlton
Copy link
Contributor Author

ccharlton commented Feb 21, 2024

I was able to get through the first few questions of the init wizard, but after picking the site it crashed.

Recipe: pantheon
Lando Command: lando init

$ lando init
? From where should we get your app's codebase? current working directory
? What recipe do you want to use? pantheon
? Enter a Pantheon machine token [hidden]
? Which site? mysite
ERROR ==> Need to give this composition a project name!

@ccharlton
Copy link
Contributor Author

ccharlton commented Feb 21, 2024

I'm suspecting it was the write permissions on /usr/local/bin/lando. Checking if that's the case now...

@ccharlton
Copy link
Contributor Author

Nope. Spoke too soon. Same error still. It seems to only be happening with one site/app. Unsure what's different with it at this time.

❯ lando init
? From where should we get your app's codebase? current working directory
? What recipe do you want to use? pantheon
? Enter a Pantheon machine token [hidden]
? Which site? mysite
ERROR ==> Need to give this composition a project name!

@AaronFeledy
Copy link
Collaborator

AaronFeledy commented Feb 22, 2024

Found another mention of this error with a workaround: https://github.com/cncf/cncf.io/blob/91473b33cc2c30ce14a9bb73dbca5d7c671a5b18/README.md?plain=1#L33

If you happen to get an error that looks like this ERROR ==> Need to give this composition a project name! then first run lando init --source pantheon. The command will fail since you already have a git repo. By running it, however, it will remember your auth for Pantheon so you won't have to enter your machine token again and the initial lando init should now work.

@reynoldsalec
Copy link
Sponsor Member

Thanks @AaronFeledy, @ccharlton did that get you around the issue?

@trackleft
Copy link

I was able to get around the issue by creating a new lando file with an id and placing it into the directory.

name: projectname
recipe: pantheon
config:
  framework: drupal8
  site: projectname
  id: 4250c474-93cc-4817-aa27-4d4c32739898

@reynoldsalec
Copy link
Sponsor Member

@ccharlton could you see if that one project is missing the name attribute in the Landofile? The Need to give this composition a project name error is triggered when you're missing that.

@markfullmer
Copy link

markfullmer commented Apr 22, 2024

could you see if that one project is missing the name attribute in the Landofile? The Need to give this composition a project name error is triggered when you're missing that.

The plugin has the name attribute, per https://github.com/lando/pantheon/blob/00cea34e4aa456a3d766cd301f6566bdb15d2edf/.lando.yml#L1

I think this problem is provoked specifically when the codebase has already been cloned down, rather than letting it be cloned from the plugin's logic.

@reynoldsalec
Copy link
Sponsor Member

@markfullmer could you paste your .lando.yml?

The name attribute we're looking for is going to be in your .lando.yml...the landofile in the root of the plugin source code is for development purposes and not directly related to the operation of the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something aint working right!
Projects
None yet
Development

No branches or pull requests

5 participants