04-27-2023 01:48 AM
Hi,
I am building a custom snap where some of the fields need to be a ‘textarea’ type. I’ve been searching through the documentation but didn’t find anything related to this.
Is there a way to make the field a text area ?
I am looking for something like the private/public keys in the account of a PGP Encrypt snap where the inputs are text area types.
On the image below, the input types are different from the ‘Key pasphrase’ which is of an ‘input’ type but the private and public keys are of ‘text area’ type.
@ptaylor Any suggestions please ?
05-04-2023 01:37 AM
SnapCompletionService
com.snaplogic.snap.api.SnapDataException: Public key: asdasd is undefined. Perhaps you meant: task, Base64, parseFloat, parseInt
at com.snaplogic.snap.api.impl.PropertyValuesImpl$ValidatingExpressionProperty.eval(PropertyValuesImpl.java:1056)
at com.snaplogic.snap.api.impl.PropertyValuesImpl$ValidatingExpressionProperty.eval(PropertyValuesImpl.java:993)
at com.iwconnect.snaps.GPGAccount.getPublicKey(GPGAccount.java:124)
at com.iwconnect.snaps.GPGEncrypt$1.write(GPGEncrypt.java:112)
at com.snaplogic.cc.snap.view.binary.BinaryOutputViewImpl.write(BinaryOutputViewImpl.java:239)
at com.snaplogic.snap.api.OutBoundViewsImpl.write(OutBoundViewsImpl.java:287)
at com.iwconnect.snaps.GPGEncrypt.process(GPGEncrypt.java:94)
at com.iwconnect.snaps.GPGEncrypt.doWork(GPGEncrypt.java:81)
at com.snaplogic.snap.api.SimpleBinarySnap.execute(SimpleBinarySnap.java:57)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.executeSnap(SnapRunnableImpl.java:812)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.execute(SnapRunnableImpl.java:586)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.doRun(SnapRunnableImpl.java:877)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:436)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:120)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Resolution: Check the spelling of the variable
Error Fingerprint[0] = efp:com.snaplogic.snap.api.impl.lsG7vC2t
@Override
public void configure(PropertyValues propertyValues) {
passphrase = propertyValues.getAsExpression(PASSPHRASE);
privateKey = propertyValues.get(PRIVATE_KEY);
publicKey = propertyValues.get(PUBLIC_KEY);
symmetricAlgorithmType = propertyValues.get(ALGORITHM);
}
The passphrase/symmetrycAlgorithmType are successfully parsed as strings. The privateKey, publicKey work fine if I remove the .uiRowCount(int) and parse them as String values for example. I am not sure if .uiRowCount(int) is the issue ?
05-04-2023 08:20 AM
It looks like GPGAccount.getPublicKey()
is evaluating the public key property as an expression even though it’s not defined as an expression. Please take a closer look at that method or share it here.
05-05-2023 02:41 AM
Sorry that’s the error message when I had the field as an expression property. This is the actual stacktrace ( the property is defined as a String and then the .get(PROPERTY_NAME) is used in the configure() method 😞
SnapCompletionService
com.snaplogic.snap.api.SnapDataException: Private key: asdasd is undefined. Perhaps you meant: task, Base64, parseFloat, parseInt
at com.snaplogic.snap.api.impl.PropertyValuesImpl$ValidatingExpressionProperty.eval(PropertyValuesImpl.java:1056)
at com.snaplogic.snap.api.impl.PropertyValuesImpl$ValidatingExpressionProperty.eval(PropertyValuesImpl.java:993)
at com.snaplogic.snap.api.impl.PropertyValuesImpl.getValueFor(PropertyValuesImpl.java:741)
at com.snaplogic.snap.api.impl.PropertyValuesImpl.getValueFor(PropertyValuesImpl.java:679)
at com.snaplogic.snap.api.impl.PropertyValuesImpl.getValueFor(PropertyValuesImpl.java:669)
at com.snaplogic.snap.api.impl.PropertyValuesImpl.get(PropertyValuesImpl.java:656)
at com.snaplogic.snap.api.impl.PropertyValuesImpl.get(PropertyValuesImpl.java:593)
at com.iwconnect.snaps.GPGAccount.configure(GPGAccount.java:100)
at com.snaplogic.cc.util.SnapUtil.configure(SnapUtil.java:374)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.configureSnap(SnapRunnableImpl.java:732)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.execute(SnapRunnableImpl.java:585)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.doRun(SnapRunnableImpl.java:877)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:436)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:120)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Resolution: Check the spelling of the variable
Only the passphrase is used as an expression and it works fine, however, the private key and public key do not work as expected.
public String getPassphrase() {
return passphrase.eval(null).toString();
}
public String getPrivateKey() {
return privateKey;
}
public String getPublicKey() {
return publicKey;
}
05-05-2023 09:50 AM
I’m confused by that stack trace since the line numbers for PropertyValuesImpl.java don’t correspond to the current version of the code, which hasn’t changed in months. What version of the platform are you using?
Also, have you tried restarting your node since changing the property from an expression to not an expression? I’ve seen issues where the platform caches some metadata about property definitions and the cache won’t reset unless you restart the process.
05-05-2023 11:23 AM
Actually, that stack trace corresponds to the state of the code prior to August 2021. So that’s really odd. In which environment is this happening?