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

Issue with custom-activity: runtime error: invalid memory address or nil pointer dereference #146

Closed
mgdevstack opened this issue Nov 4, 2017 · 6 comments

Comments

@mgdevstack
Copy link

We are facing runtime error: invalid memory address or nil pointer dereference with every custom activity. Is there anything missing?

Created a simple activity (simpletest) to demonstrate the issue:
https://github.com/mgdevstack/flogo-contrib/tree/master/activity/simpletest

flogoapp to test: https://github.com/mgdevstack/flogo/tree/master/apps/simpleapp
flogo.json

{
  "name": "testingapp",
  "type": "flogo:app",
  "version": "0.0.1",
  "description": "",
  "triggers": [
    {
      "name": "Timer",
      "ref": "github.com/TIBCOSoftware/flogo-contrib/trigger/timer",
      "description": "Simple Timer trigger",
      "settings": {},
      "id": "timer",
      "handlers": [
        {
          "settings": {
            "repeating": "true",
            "notImmediate": "false",
            "startDate": "",
            "hours": "",
            "minutes": "",
            "seconds": "5"
          },
          "actionId": "sactivity"
        }
      ]
    }
  ],
  "actions": [
    {
      "name": "sactivity",
      "data": {
        "flow": {
          "type": 1,
          "attributes": [],
          "rootTask": {
            "id": 1,
            "type": 1,
            "tasks": [
              {
                "id": 2,
                "name": "activity-test",
                "description": "test activity",
                "type": 1,
                "activityType": "mgdevstack-activity",
                "activityRef": "github.com/mgdevstack/flogo-contrib/activity/simpletest",
                "attributes": [
                  {
                    "name": "input",
                    "value": "Activity Input",
                    "required": true,
                    "type": "string"
                  }
                ]
              }
            ],
            "attributes": []
          }
        }
      },
      "id": "sactivity",
      "ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow"
    }
  ]
}

Below is the screenshot of StackTrace fetched from

....github.com/mgdevstack/flogo/apps/simpleapp/vendor/src/github.com/TIBCOSoftware/flogo-contrib/action/flow/instance/instance.go:264

sc2

sc1

I couldn't able to debug values in channels but I'm sure we are missing to handle any error in specified go routine of execTask(workItem *WorkItem) function. Can anyone debug the issue with custom activity or this app?

Referencec:
Activity: https://github.com/mgdevstack/flogo-contrib/tree/master/activity/simpletest
App: https://github.com/mgdevstack/flogo/tree/master/apps/simpleapp

@mgdevstack
Copy link
Author

mgdevstack commented Nov 4, 2017

@torresashjian, Can you please have look on this as a priority issue. None of my applications are running due to this error where custom activities are involved in the flow.

I tried using docker UI to install my custom activities but it shows "install successful" but activities are not visible in UI to add.

Reference: https://github.com/mgdevstack/flogo-contrib/tree/master/activity/pahoMQTT

@torresashjian
Copy link
Contributor

Hi @mgdevstack it seems like your activity.json in https://github.com/mgdevstack/flogo-contrib/tree/master/activity/simpletest is missing the "ref" property. Try with this:
{
"name": "simpletest",
"version": "0.0.1",
"type": "flogo:activity",
"ref": "github.com/mgdevstack/flogo-contrib/activity/simpletest",
"description": "Simple Activity to test",
"author": "Mayank Gaikwad mg.devzone@gmail.com",
"inputs":[
{
"name": "input",
"type": "string"
}
],
"outputs": [
{
"name": "output",
"type": "string"
}
]
}

@mgdevstack
Copy link
Author

mgdevstack commented Nov 4, 2017

@torresashjian, I tried with above fix, but it's not working.
mgdevstack@c007178

As in application's flogo.json, activityref is already provided. I don't think, ref in activity.json should hold any importance. (As we first create activity with flogogen and then push to github / central repo)
i.e. https://github.com/mgdevstack/flogo/blob/098bb642733ce8f7d38939e72fe92653b21ef355/apps/simpleapp/flogo.json#L45

Any other points to debug?

@mgdevstack
Copy link
Author

Thanks @torresashjian, I hope, the problem is resolved with your suggestion. If ref attribute in activity.json is the reason behind this issue, we need to fix codebase to pick up activity reference from application's flogo.json (activityRef attribute) not from activity.json (ref attribute) because as earlier mentioned, we create activity first, push this to git and then reference this activity in the application.

Is it worth doing?

@mellistibco
Copy link
Collaborator

@mgdevstack was your issue resolved? will look into the feasibility around your suggestion. perhaps @fm-tibco has some thoughts?

@mellistibco
Copy link
Collaborator

Closing with the assumption that the issue is solved... opened a new issue TIBCOSoftware/flogo#183 to track @mgdevstack's suggestion around ref

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

3 participants