Closed c256985 closed 6 years ago
I can't reproduce this behavior. Can you please provide a sample project which demonstrates the problem?
Thanks for your feedback.
@jeffbrown You might try creating an empty project with grails 3.3.1 and then try running it with grails 3.3.2. If that doesn't work then try building the same project with the latest version of gradle (4.4.1) and see if that does the trick.
If neither of those approaches work, let me know and I'll strip down this project and see if I can create something that reproduces this. Seeing as the error has been reported previously though, there should be some way of reproducing it.
Regards,
Mark
You might try creating an empty project with grails 3.3.1 and then try running it with grails 3.3.2.
That wasn't able to reproduce the problem for me but even if it didn't, running a 3.3.1 app with 3.3.2 isn't supported anyway.
If that doesn't work then try building the same project with the latest version of gradle (4.4.1) and see if that does the trick.
If I have Gradle 4.4.1 on my path and start the Grails console by running grails
with no args, that doesn't seem to trigger the problem.
If neither of those approaches work, let me know and I'll strip down this project and see if I can create something that reproduces this.
If you could share a project like that, that would be a big help.
Thanks for the feedback.
Sometimes after upgrading the version of Intelli-J that I'm using for development, when I try to run the command-line grails program, I receive the following error message:
Error occurred running Grails CLI: No profile found for name [web].
After searching around the web, I found that this was due to a problem with the build/.dependencies file located within your Grails project root. If you delete or rename this file, then run grails again, the dependencies will be corrected and you can run your app.
I'm also having a similar issue with 3.3.2. Working on updating our project from 2.5.5 and getting:
| Error Error occurred running Grails CLI: No profile found for name [web-plugin]. (Use --stacktrace to see the full trace)
This is an inline plugin that we are using. If I change application.groovy to 'web', it works. I also tested 'plugin' and it doesn't work either.
Nevermind, I found my problem. The profile in build.gradle needs to match the one in the configuration. I had copied some stuff from our webapp and forgot to change it.
profile "org.grails.profiles:web-plugin" // needs to match the profile configured
Try and upgrade your Grails version and see if this issue persists. If it doesn't, please proceed to closing this issue right away.
So far there are no problems like this happening to me across the development of my project, and I've successfully done version migration.
Here is an example of a project that exhibits this behaviour: https://github.com/spierepf/hms
Still not being able to reproduce it even with the sample project:
$ git clone git@github.com:spierepf/hms.git
Cloning into 'hms'...
remote: Counting objects: 168, done.
remote: Compressing objects: 100% (96/96), done.
remote: Total 168 (delta 39), reused 168 (delta 39), pack-reused 0
Receiving objects: 100% (168/168), 183.68 KiB | 691.00 KiB/s, done.
Resolving deltas: 100% (39/39), done.
$ cd hms
$ grails
| Resolving Dependencies. Please wait...
CONFIGURE SUCCESSFUL
| Starting interactive mode...
| Enter a command name to run. Use TAB for completion:
grails>
@ilopmar are you just running from the command line, or do you have the project also configured as an IDEA project?
I only run it from the command line. But now I've tried again cloning the repo, configuring it in IntelliJ and then executing grails
on the command line. It still works.
Problem appears to be isolated to IntelliJ (my current version is IDEA Ultimate 2017.3.4 with Grails 3.3.2). Kudos to @puwanatfx for his suggestion above on Jan 10, 2018 , this worked like a charm for me. I was also not able to reproduce this in Grails standalone or with a brandnew IntelliJ project. Suggest to close as IDE issue.
👍👍👍
On Mon, Feb 26, 2018, 8:07 PM Iván López notifications@github.com wrote:
Closed #10898 https://github.com/grails/grails-core/issues/10898.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/grails/grails-core/issues/10898#event-1491856030, or mute the thread https://github.com/notifications/unsubscribe-auth/AAV8cbqVgID7aOjC6QAKoWlojTVJ0wKHks5tYp6MgaJpZM4RPa8o .
--
Sincerely, Kevin H.A. Tan Polyglot Software Developer, Technopreneur http://about.me/kevintanhongann
+60182013739
In my case this error happens on Grails 3.1.10 and the reason is because my Nexus Repository Manager was offline and Grails wasn't able to resolve dependencies. I discover that typing: "./gradlew clean"
For me, problem was solved also by
./gradlew clean
This error to due to maven was installed in you system..
follow the below steps
try to above step.. it will work fine
I got the same issue but in the context that I copied the source codes from the local machine to the server without cleaning up. I think this is the point we need to take into account. That's why someones here resolved the problem by just run clean.
I don't know if this will help anyone, but my solution was to delete the build folders and rerun the project.
Hi Joklek, I had the same issue (Grails 4.0.0) which I did not touch for some time, and deleting the build did solve the issue (even Intellij - grails - run - clean) did not work. Thanks
Strange, this happened to me today, just running a project that ran OK before and getting this error.
tried ./gradlew clean and it worked, not sure what was going on.
Tried the same project on another machine and got exactly the same error, anything grails xxx executed in the terminal terminates with the "no profile found" error. ./gradlew clean again worked.
@ppazos could you create an example repository and post it here, if you can still reproduce the issue. Also your Gradle and grails versions, your OS.
@joklek it happened on a specific repo on two different machines, I have other projects in 3.3.x and didn't have an issue with those, not sure I can reproduce from scratch.
I'm on grails 3.3.10 linux mint 19
grailsVersion=3.3.10 gormVersion=6.1.12.RELEASE gradleWrapperVersion=3.5
I had the same issue, solved by executing the gradle clean task
I do it all the time.
I had the same issue this morning. Gradle clean didn't work. Deleting the build directory manually worked for me.
Not sure why this keeps happening. I just worked all day on a grails project without any issues. At the next day I do grails run-app and got the profile not found thing.
Sometimes after upgrading the version of Intelli-J that I'm using for development, when I try to run the command-line grails program, I receive the following error message:
Error occurred running Grails CLI: No profile found for name [web].
After searching around the web, I found that this was due to a problem with the build/.dependencies file located within your Grails project root. If you delete or rename this file, then run grails again, the dependencies will be corrected and you can run your app.
Thank you @puwanatfx , It worked for me.
A different situation maybe. I generally face the same problem time and again. But it only happens after I run a separate SpringBoot application using Gradle specifically. I will have to a grails clean operation to be able to run a grails app again.
On Tue, 30 Nov 2021, 05:38 vishwadeepghimirezph @.***> wrote:
Sometimes after upgrading the version of Intelli-J that I'm using for development, when I try to run the command-line grails program, I receive the following error message:
Error occurred running Grails CLI: No profile found for name [web].
After searching around the web, I found that this was due to a problem with the build/.dependencies file located within your Grails project root. If you delete or rename this file, then run grails again, the dependencies will be corrected and you can run your app.
Thank you @puwanatfx https://github.com/puwanatfx , It worked for me.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grails/grails-core/issues/10898#issuecomment-982254373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTH5PNHPKHB6JQFPM6MGDUORBMNANCNFSM4EJ5V4UA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
I know this is an old issue and has been closed, but I am going to add another potential cause since a lot of people have found their way here:
build.groovy:
profile "org.grails.profiles:angular"
application.yml:
grails.profile: web
Make sure these agree with each other.
After working with the project for a while, when I try to run grails from the command line, I get the following error message: Error occurred running Grails CLI: No profile found for name [web]
Since this uses the rest-api profile and not the web profile, there should be no reason for me getting this issue. Something in the project must be telling grails that this is a web project. However, I haven't been able to find any configuration variable, or any dependency that would suddenly require grails to use the web profile.
The project was created with grails 3.3.1.
Task List
Steps to Reproduce
Error occurred running Grails CLI: No profile found for name [web]. (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) java.lang.IllegalStateException: No profile found for name [web]. at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:519) at org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:307) at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:270) at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
Expected Behaviour
Grails should run.
If I upgrade gradle, the grails app should still run. If I upgrade grails, the app should still work. I shouldn't have to recreate the project, or do anything else except run the application, or do a clean build, or any of the normal things that every developer does. It shouldn't fail, and tell me some message that should never occur on a headless rest app.
Actual Behaviour
Tell us what happens instead
Environment Information
|Grails Version: 3.3.2 |Groovy Version: 2.4.13 |JVM Version: 1.8.0_144
Example Application
I've tried doing a gradle clean build. I've tried manually deleting the .gradle/4.4.1 directory. None of these things actually work.