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

Parsing of calsync.conf fails to extract username and password #11

Open
ralphholz opened this issue Feb 13, 2021 · 2 comments
Open

Parsing of calsync.conf fails to extract username and password #11

ralphholz opened this issue Feb 13, 2021 · 2 comments

Comments

@ralphholz
Copy link

ralphholz commented Feb 13, 2021

Following the instructions, I get the following when running calsync the second time, after editing the config file:

exchange.username.env: Environment variable does not have a value

This is independent of whether the strings are quoted or not. It seems the config file is not parsed correctly?

EDIT: JDK 15 by Oracle, macOS. Not sure if that can cause a difference.

@ralphholz
Copy link
Author

Not knowing Groovy at all, but I wonder if this line, src/main/groovy/com/github/choonchernlim/calsync/core/UserConfigReader.groovy:121,

String value = System.getenv(env)?.trim()

is actually trying to read from the environment variables of the system and not from the config file. Unless the code tries to load them into the environment somewhere else (but fails?).

@ralphholz
Copy link
Author

Full call stack:

Exception in thread "main" com.github.choonchernlim.calsync.core.CalSyncException: The configuration is invalid. Please fix the errors below, then run it again:-
- exchange.username.env: Environment variable does not have a value.
- exchange.password.env: Environment variable does not have a value.
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
	at com.github.choonchernlim.calsync.core.UserConfigReader.validate(UserConfigReader.groovy:89)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:61)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
	at com.github.choonchernlim.calsync.core.UserConfigReader.getUserConfig(UserConfigReader.groovy:29)
	at com.github.choonchernlim.calsync.core.UserConfigReader$getUserConfig.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
	at com.github.choonchernlim.calsync.core.Main.main(Main.groovy:19)```

Config file is not invalid - values are set.

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

1 participant