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

Error: github.com/project-flogo/legacybridge] - interface conversion: interface {} is nil, not string #515

Open
neethuabacker opened this issue Nov 13, 2019 · 18 comments
Assignees

Comments

@neethuabacker
Copy link

neethuabacker commented Nov 13, 2019

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: retgits/flogo-components#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):
retgits/flogo-components#15 has all additional information including app json file

@skothari-tibco
Copy link

Can you share the error logs once again?

Thanks.

@neethuabacker
Copy link
Author

sure, attached
flogolog.txt

@neethuabacker
Copy link
Author

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?

@retgits
Copy link
Contributor

retgits commented Nov 13, 2019

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

@skothari-tibco
Copy link

skothari-tibco commented Nov 13, 2019

@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.

@retgits
Copy link
Contributor

retgits commented Nov 13, 2019

@skothari-tibco
Copy link

I meant in the flogo json.

@retgits
Copy link
Contributor

retgits commented Nov 13, 2019

Ah okay 😄 just out of curiosity, does the legacybridge try to parse every field even if they're optional?

@neethuabacker
Copy link
Author

yes, i have same question, was typing it :) why for optional fields I have to provide values..

@neethuabacker
Copy link
Author

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 )

@skothari-tibco
Copy link

skothari-tibco commented Nov 13, 2019

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.

@mellistibco
Copy link
Collaborator

mellistibco commented Nov 13, 2019

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...

@mellistibco
Copy link
Collaborator

@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 ;)

@mellistibco
Copy link
Collaborator

mellistibco commented Nov 13, 2019

@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

@retgits
Copy link
Contributor

retgits commented Nov 13, 2019

@mellistibco yeah, I'd gladly contribute mine :) which repo should I create a PR for?

@mellistibco
Copy link
Collaborator

@retgits 🎉 👏
https://github.com/project-flogo/aws-contrib

@retgits
Copy link
Contributor

retgits commented Nov 13, 2019

Added project-flogo/aws-contrib#7

@neethuabacker
Copy link
Author

@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

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

5 participants