Code Monkey home page Code Monkey logo

Comments (30)

phanirithvij avatar phanirithvij commented on August 26, 2024

Working one

image

Github is not working

image

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

And this is how my auth looks (I hid the access token)

image

from n8n.

janober avatar janober commented on August 26, 2024

Hello!

I just tested and for me it seems to work fine.

So are you running it locally? Because then you have an http://localhost URL and Github can not create a webhook to such a URL (as it would be their own localhost). You need a "proper" domain to create a webhook. n8n has a special tunnel service which makes that very easy. You simply have to start n8n like this: n8n start --tunnel

It will then create a unique URL on our tunnel-service for you and redirect that requests to your local server.

If that is not the problem I pasted full workflow at the end of the message. You can simply copy it, then click in the n8n-editor window and paste. It will then create the whole workflow. You then just have to change the credentials on the nodes and the Github repository.

Hope that helps. If not simply get back to me!

{
  "nodes": [
    {
      "parameters": {
        "owner": "n8n-io",
        "repository": "n8n",
        "events": [
          "star"
        ]
      },
      "name": "Github Trigger",
      "type": "n8n-nodes-base.githubTrigger",
      "typeVersion": 1,
      "position": [
        210,
        350
      ],
      "credentials": {
        "githubApi": "janober"
      }
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$node[\"Github Trigger\"].data[\"body\"][\"action\"]}}",
              "value2": "created"
            }
          ]
        }
      },
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        400,
        350
      ]
    },
    {
      "parameters": {
        "channel": "#test",
        "attachments": [
          {
            "image_url": "={{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"avatar_url\"]}}",
            "title_link": "={{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"html_url\"]}}",
            "title": "=Got new star from: {{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"login\"]}}",
            "text": "=The project has now: {{$node[\"Github Trigger\"].data[\"body\"][\"repository\"][\"stargazers_count\"]}} Stars",
            "color": "#88FF00"
          }
        ],
        "otherOptions": {}
      },
      "name": "Slack - Add",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        600,
        250
      ],
      "credentials": {
        "slackApi": "n8n"
      }
    },
    {
      "parameters": {
        "channel": "#test",
        "attachments": [
          {
            "image_url": "={{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"avatar_url\"]}}",
            "title_link": "={{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"html_url\"]}}",
            "title": "=Star got removed by: {{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"login\"]}}",
            "text": "=The project has now: {{$node[\"Github Trigger\"].data[\"body\"][\"repository\"][\"stargazers_count\"]}} Stars",
            "color": "#ff0000"
          }
        ],
        "otherOptions": {}
      },
      "name": "Slack - Remove",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        600,
        450
      ],
      "credentials": {
        "slackApi": "n8n"
      }
    }
  ],
  "connections": {
    "Github Trigger": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF": {
      "main": [
        [
          {
            "node": "Slack - Add",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack - Remove",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

from n8n.

janober avatar janober commented on August 26, 2024

Hi!
Does it work now or do you still have issues?

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

from n8n.

janober avatar janober commented on August 26, 2024

Hello!
Very strange. Did you check if it creates the webhook on Github. You can see it under this URL (you just have to replace it with the user and repository name you want to watch):
https://github.com///settings/hooks

If you start it manually it should create a webhook there and after it got "stared" or "unstared" it should get removed again automatically.

Ah yes it has an automatic timeout build in to not wait "indefinitely". If the test-webhook does not get called within 120 seconds it will stop and resolve.

What do you mean you can not connect anything to the start node? You mean as an input? If so, that is OK as the start node does not have an input and so nothing can be connected to it. It has only an output (all trigger nodes currently have). If you want that a node can receive input data from two different nodes (for example the "Start-Node" and the "Webhook-Node") you would simply use both of them as the input of this node.

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

It is creating a webhook URL but the response seems to be a 404.
Here's a screenshot

image

image

from n8n.

janober avatar janober commented on August 26, 2024

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

from n8n.

janober avatar janober commented on August 26, 2024

Hm no sounds all correct to me. How do you start n8n? Via npm or docker?

from n8n.

janober avatar janober commented on August 26, 2024

Btw. did release a new version which fixed a bug that it took much longer than needed for the Editor-UI to get data. Do not think that causes your problem but who knows.

Do regular webhooks work for you? So if you for example create a new workflow with that node in it:

{
  "nodes": [
    {
      "parameters": {
        "path": "test"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        593,
        314
      ]
    }
  ],
  "connections": {}
}

You then press "Execute Workflow" and then visit directly this page with your browser (replace <WORKFLOW_ID> with the id your workflow got saved as):

http://localhost:5678/webhook-test/<WORKFLOW_ID>/webhook/test

Does it then resolve correctly and display you data on the webhook node?

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

This one works.

{
  "nodes": [
    {
      "parameters": {
        "path": "test"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        593,
        314
      ]
    }
  ],
  "connections": {}
}

The URL gave me a data

{"message":"Workflow got started."}

Does it then resolve correctly and display your data on the webhook node?

Then it resolved after some time and I received the data

{
  "host": "localhost:5678",
  "connection": "keep-alive",
  "upgrade-insecure-requests": "1",
  "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
  "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
  "accept-encoding": "gzip, deflate, br",
  "accept-language": "en-US,en;q=0.9",
  "cookie": "wcsid=ylUAvqLrAsS5HJ3W3m39N0JABkr36o7C; hblid=KbnytDPkeEmyDkPS3m39N0JAA6T6oBr3; _okdetect=%7B%22token%22%3A%2215610205567100%22%2C%22proto%22%3A%22http%3A%22%2C%22host%22%3A%22localhost%3A4040%22%7D; olfsk=olfsk3027408582743829; _okbk=cd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1561020556869%2Cvi3%3Dactive%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; _ok=1700-237-10-3483; _oklv=1561021588077%2CylUAvqLrAsS5HJ3W3m39N0JABkr36o7C; username-localhost-8888=\"2|1:0|10:1565090142|23:username-localhost-8888|44:ZDMwMTI5NDFmMGVkNGQxZjlkYzQ2YTM4ZGUwMDJkZTc=|6a8bf9d70c674587a929cb5638019b436f990599172d1a7c42c2e927baa3998c\"; _xsrf=2|832e7633|8f4242fb9c6ee055293f9b5d2572f454|1565090142"
}

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

When I tried n8n start --tunnel

And ran a simple github star workflow

I can see some webhooks in my project settings but they are all getting 404 from the ngnix server i.e. the tunnel I'm guessing.

image

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

I installed n8n from npm.

image

And this is my downloaded json workflow file.
github.zip

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

A post request is being sent to the tunnel server by github when I star or unstar the repo but the tunnel server is responding with 404.

And I simply get a 404 when I send a get request to the tunnel.
curl -i https://rk9kdgf84juxb6cemo1u0myv.hooks.n8n.cloud/

from n8n.

janober avatar janober commented on August 26, 2024

hm then it is even more confusing. When the webhook node works, the Github node should theoretically also work as they use to 100% the same code.

The nodes you did send look like totally right (even though they do not work for me as I can not set a hook on a repository I am not part of).

When you only click "Execute Workflow" and then go on the Github webhook page does it then display that webhook as OK with a green checkmark like this?
Screenshot from 2019-08-06 22-55-58

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

No, it is a red warning icon.

image

I'm guessing the problem is with your cloud provider? Or it might be that it's not available for me or my region specifically.

from n8n.

janober avatar janober commented on August 26, 2024

Hm ok then it is really the inital request already. So probably really nothing at all gets through for some reason and it has really something to do with the tunnel.

Can you please start again with n8n with the tunnel, then make sure that you reload the browser with the Editor-UI. If you go then in the Webhook-Node and click on the orange "Webhook URLs" to display them you should see the Webhook-URLs. Then select "Test" and copy the URL by clicking on it (it should contain "webhook-test"). If you now start again the workflow and call the copied URL which goes now through the tunnel does it then also resolve and work like it does when you use the localhost URL?

from n8n.

janober avatar janober commented on August 26, 2024

And just to be very sure that you have not have for some reason a very strict firewall in place. Can you please deactivate it and try then again the Github Trigger Node.

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

It's not because of the firewall.
I just disabled it entirely and I still get no data.

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

I re-enabled my firewall.

And now I get this

There was a problem running the workflow:
Github error response [422]: Validation Failed

The traceback

ERROR RESPONSE
Error: Github error response [422]: Validation Failed
    at Object.githubApiRequest (C:\PROGRA~1\node11\node_modules\n8n\node_modules\n8n-nodes-base\dist\nodes\Github\GenericFunctions.js:27:19)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

from n8n.

janober avatar janober commented on August 26, 2024

I am very sorry but I am not able to help you.

I now did extra set up everything totally new on a clean Windows (as I use Ubuntu) with new Github API token and hoped so to be able to reproduce your problem but "sadly" everything worked perfectly. Have not the slightest idea why it does not work for you. Hope you can figure out what is different for you.

For your (and the most people in general) it makes the most sense anyway to have it running on a server and not locally. So I advice you to get it up and running on a Linux-Server as the problem seems to be related to your computer somehow. I am sure there it will then work just fine.

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

from n8n.

janober avatar janober commented on August 26, 2024

Would be great, especially if it turns out to be a problem which maybe more people will have. Anyway the offer I did send you via email with the free hosted instance still stands.

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

Great project btw.

from n8n.

janober avatar janober commented on August 26, 2024

Ah just saw your messages now. Really great to hear that this mystery is now solved.

from n8n.

phanirithvij avatar phanirithvij commented on August 26, 2024

And how can I change the n8n configuration settings?
Like e.g. You've disabled Execute command node on your hosted server.
Is it possible to do it locally?

from n8n.

janober avatar janober commented on August 26, 2024

Everything that can be configured can be found here:
https://github.com/n8n-io/n8n/blob/master/packages/cli/config/index.ts

To not load some node types the "NODES_EXCLUDE" environment variable can be set.

I for example set this one:

export NODES_EXCLUDE="[\"n8n-nodes-base.executeCommand\", \"n8n-nodes-base.readBinaryFile\", \"n8n-nodes-base.readBinaryFiles\", \"n8n-nodes-base.writeBinaryFile\"]"

from n8n.

iosifnicolae2 avatar iosifnicolae2 commented on August 26, 2024

If you want to find the URL where the Webhook is accessible, please toggle the "Webhook URL" section:
image

from n8n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.