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

Couldn't fetch build details; and Couldn't fetch changes; inside slack notifications #40

Closed
dennislo opened this issue Apr 18, 2016 · 3 comments

Comments

@dennislo
Copy link

dennislo commented Apr 18, 2016

I'm see the following errors Couldn't fetch build details; and Couldn't fetch changes; inside the slack notifications, see screen shot below:

screen shot 2016-04-18 at 18 02 37

Here is the go_notify.conf

gocd.slack {
  login = "username"
  password = "password"
  server-host = "http://localhost:8153/"
  api-server-host = "http://localhost:8153/"
  webhookUrl = "https://hooks.slack.com/services/..........."

  # Generic slack channel
  channel = "#gocd-test" 

  # Bot 
  slackDisplayName = "gocd"
  slackUserIconURL = "https://testing.com/gocd.png"

  # Pipelines
  pipelines = [{
    name = "slack-integration"
    stage = "defaultStage"
    state = "all"
    channel = "#gocd-test"
  },
  {
    name = ".*"
    stage = ".*"
    state = "all"
  }]
}

Versions:
Slack Notification Plugin 1.2.1
Go Version 16.3.0(3183-60d6fd31f00527da00f2affdd8f7f7732e7be103)

@ashwanthkumar
Copy link
Owner

@dennislo Can you please share the go server and plugin logs relevant to this error?

@dennislo
Copy link
Author

dennislo commented Apr 19, 2016

@ashwanthkumar I have the go server installed on my local os x machine and was not sure where the server logs are, I'm guessing: /Users/dennis/Library/Application Support/Go Server/go-server.log

I think I managed to find the plugin slack notification logs? I'm guessing: /Users/dennis/Library/Application Support/Go Server/plugin-slack.notifier.log

2016-04-18 18:01:37,123  INFO [70@MessageListener for PluginNotificationListener] Server:52 - Fetching http://localhost:8153//go/api/pipelines/slack-integration/instance/10
2016-04-18 18:01:37,124  WARN [70@MessageListener for PluginNotificationListener] SlackPipelineListener:67 - Couldn't fetch changes
java.io.FileNotFoundException: http://localhost:8153//go/api/pipelines/slack-integration/instance/10
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1836)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
    at java.net.URLConnection.getContent(URLConnection.java:739)
    at in.ashwanthkumar.gocd.slack.jsonapi.Server.getUrl(Server.java:55)
    at in.ashwanthkumar.gocd.slack.jsonapi.Server.getPipelineInstance(Server.java:78)
    at in.ashwanthkumar.gocd.slack.GoNotificationMessage.fetchChanges(GoNotificationMessage.java:213)
    at in.ashwanthkumar.gocd.slack.SlackPipelineListener.slackAttachment(SlackPipelineListener.java:93)
    at in.ashwanthkumar.gocd.slack.SlackPipelineListener.onPassed(SlackPipelineListener.java:42)
    at in.ashwanthkumar.gocd.slack.ruleset.PipelineStatus$2.handle(PipelineStatus.java:22)
    at in.ashwanthkumar.gocd.slack.PipelineListener.handlePipelineStatus(PipelineListener.java:31)
    at in.ashwanthkumar.gocd.slack.PipelineListener.notify(PipelineListener.java:24)
    at in.ashwanthkumar.gocd.slack.GoNotificationPlugin.handleStageNotification(GoNotificationPlugin.java:121)
    at in.ashwanthkumar.gocd.slack.GoNotificationPlugin.handle(GoNotificationPlugin.java:59)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:172)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:167)
    at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:315)
    at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:245)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:167)
    at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:32)
    at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:66)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugin(PluginNotificationService.java:61)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugins(PluginNotificationService.java:53)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:30)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:21)
    at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:65)
    at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:50)
    at java.lang.Thread.run(Thread.java:745)

It looks like because I used api-server-host = "http://localhost:8153/" notice the trailing /, the error is SlackPipelineListener:67 - Couldn't fetch changes java.io.FileNotFoundException: http://localhost:8153//go/api/pipelines/slack-integration/instance/10. The URL is malformed with the double //after the port number.

I changed the go_notify.conf file api-server-host = "http://localhost:8153" (notice the missing trailing /) but I still get the same issue in the slack notifications.

Then I changed server-host = "http://localhost:8153" (again notice the missing trailing /), and it fixed the issue. I no longer see the same issue in the slack notifications.

So it looks like the code that parses the conf doesn't support trailing /?

It might be helpful updating the readme.md as well as it contains an example conf with trailing /

@ashwanthkumar
Copy link
Owner

@dennislo Thanks for pointing this out. I've fixed this on the master. Next release should just work with trailing / as well.

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

2 participants