Not a showstopper, more a curiosity, as it doesn't...
# questions
j
Not a showstopper, more a curiosity, as it doesn't appear to cause any problems, but... At some point in attempting to build or run a Grails 7 app, converted from Grails 6, a new directory has been created called 'USER_HOME_IS_UNDEFINED'. It contains a '.grails' directory.
g
I dont' know if it's the same but I had this issue, it is probably still to be fixed: https://github.com/apache/grails-core/issues/12874
I've replied too quickly, I guess that's not the problem
j
Is this after running ./grails or ./grailsw?
j
It's a Grails 7 thing, even if it originates in my app, as it has not occurred befor,e in 5 or 6. Not sure what precipitated it, it was a while before I noticed the directory.
j
Does it have a wrapper directory under .grails?
Normal that lands in ~/.grails/wrapper
IntelliJ (I'm guessing the Grails plugin) also stores some print settings is ~/.grails/scripts
j
No, the .grails directory contains a directory called spring.application.name_IS_UNDEFINED, in which there is a stacktrace.log.
j
See if groovy can find
user.home
, if it cannot, you will need to dig into setting on your OS But this in BootStrap.init {} and run bootRun
Copy code
println System.getProperty("user.home")
j
Deleted the 'USER_HOME_IS_UNDEFINED' directory, did ./gradlew bootRun, and my user home directory was correctly printed out - but the rogue directory was recreated.
j
I am at a loss. AI's suggest was to check logback-spring.xml or if you still have it named logback.xml rename to logback-spring.xml and check it against the one generated from start.grails.org
I have not see this personally and have run hundreds of Grails 7 apps over the last year and I think you may the first to report it.
j
I wouldn't worry about it. As I said, it was not a showstopper and doesn't cause any problems, it was just a bit of an oddity.
Thanks for looking, though!
I do have a logback-spring.xml, converted (by AI) from logback.groovy which I had before. Looks OK to me: <?xml version="1.0" encoding="UTF-8"?> <configuration> <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <charset>UTF-8</charset> <pattern> %clr(%d{yyyy-MM-dd HHmmss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex </pattern> </encoder> </appender> <springProfile name="development"> <property name="LOG_FILE_LOCATION" value="${USER_HOME}/.grails/${spring.application.name}/stacktrace.log" /> <appender name="FULL_STACKTRACE" class="ch.qos.logback.core.FileAppender"> <file>${LOG_FILE_LOCATION}</file> <append>true</append> <encoder> <charset>UTF-8</charset> <pattern>%level %logger - %msg%n</pattern> </encoder> </appender> <logger name="StackTrace" level="ERROR" additivity="false"> <appender-ref ref="FULL_STACKTRACE" /> </logger> </springProfile> <root level="ERROR"> <appender-ref ref="STDOUT" /> </root> <logger name="grails.app" level="INFO" additivity="false"> <appender-ref ref="STDOUT" /> </logger> <logger name="org.hibernate.orm.deprecation" level="ERROR" additivity="false"> <appender-ref ref="STDOUT" /> </logger> <logger name="org.springframework.web.socket.config.WebSocketMessageBrokerStats" level="ERROR" additivity="false"> <appender-ref ref="STDOUT" /> </logger> <logger name="org.grails.config.NavigableMap" level="ERROR" additivity="false"> <appender-ref ref="STDOUT" /> </logger> </configuration>