flogo
flogo copied to clipboard
Error: github.com/project-flogo/legacybridge] - interface conversion: interface {} is nil, not string
Current behavior (how does the issue manifest): I am working on open source Amazon S3 connector which throws me an error when connecting to S3 that says : github.com/project-flogo/legacybridge] - interface conversion: interface {} is nil, not string I raised a case against the connector, but I am told that its related to legacybridge changes. Please see this issue: https://github.com/retgits/flogo-components/issues/15
Expected behavior:
Minimal steps to reproduce the problem (not required if feature enhancement):
Please tell us about your environment (Operating system, docker version, browser & web ui version, etc):
Flogo version (CLI & contrib/lib. If unknown, leave empty or state unknown): 0.X.X Flogo v0.9.2 Additional information you deem important (e.g. issue happens only occasionally): https://github.com/retgits/flogo-components/issues/15 has all additional information including app json file
Can you share the error logs once again?
Thanks.
sure, attached flogolog.txt
just noticed there is another error too: InvalidEndpointURL: invalid endpoint uri caused by: parse https://s3.US East (N. Virginia).amazonaws.com/{Bucket}/{Key+}: invalid character " " in host name github.com/project-flogo/core/support/log.(*zapLoggerImpl).Errorf. How is it building the https:// endpoint?
The HTTPS endpoint for the S3 Activity is built by the AWS Go SDK. It uses the identifier of the region (like us-west-2
) and not the name itself. So the region in line 83 has to be set according to the regions specified by AWS. In your case, US East (N. Virginia)
should be us-east-1
@neethuabacker the error, it seems to me that, it's coming from activity.
https://github.com/retgits/flogo-components/blob/master/activity/amazons3/activity.go#L56
, this one in particular. There's no localLocation in the JSON. And thus interface conversion is nil not string. @mellistibco should we add s3 activity in project-flogo/aws-contrib
. Edit with aws-contrib not the original one.
@skothari-tibco there is a localLocation in the JSON 😉 https://github.com/retgits/flogo-components/blob/master/activity/amazons3/activity.json#L48
I meant in the flogo json.
Ah okay 😄 just out of curiosity, does the legacybridge try to parse every field even if they're optional?
yes, i have same question, was typing it :) why for optional fields I have to provide values..
also, just fyi. i got that {} nil error on a timer where I did not give a frequency interval too, when frequency is optional. something is not right. ( then i changed my code to http trigger to get past it )
I think it's just with the old contributions. The legacy bridge passes the context with the values provided in the JSON to the legacy activity.If there's no value associated with it, it passes {}
. This https://github.com/project-flogo/legacybridge/blob/master/activity.go#L151
shows a small snippet.
With the new contributions if it's optional, it's fine if you don't have it.
The old version (0.5.x) would return nil if an optional param was not specified, so technically the behavior is the same... So the coerce to a string in the activity would be causing an issue... Even the tests for the activity set localLocation
to an empty string, rather than not setting it...
@skothari-tibco as for your question about adding the s3 activity to the aws-contrib
repo in the project-flogo org... Maybe @retgits would be kind enough to contribute his ;)
@neethuabacker for the timer, were you using the new timer trigger? That is, this one: https://github.com/project-flogo/contrib/tree/master/trigger/timer
@mellistibco yeah, I'd gladly contribute mine :) which repo should I create a PR for?
@retgits 🎉 👏 https://github.com/project-flogo/aws-contrib
Added https://github.com/project-flogo/aws-contrib/pull/7
@neethuabacker for the timer, were you using the new timer trigger? That is, this one: https://github.com/project-flogo/contrib/tree/master/trigger/timer
no, I am using the timer that came with project flogo, did not install any other timer