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

json: cannot unmarshal array into Go value of type responses.PHIDLookupResponse #27

Closed
pdilyard opened this issue Mar 11, 2016 · 9 comments

Comments

@pdilyard
Copy link

Consistently getting this error:

ERRO[0003] json: cannot unmarshal array into Go value of type responses.PHIDLookupResponse 

I'm on the latest master branch of Phabricator, and I have tried both release 2.3.0 of Phabulous, as well as manually compiling the master branch. I got the same error from both.

I've been testing by sending the message "lookup T123" to the Phabulous bot, and it has resulted in the above error every time (and the bot responds with an error message in the chat).

Here's my configuration:

server:
  port: 8085
  debug: false

  # Serious-mode makes some messages more formal and business-friendly.
  serious: false
slack:
  token: REDACTED
  username: phabricator
conduit:
  api: REDACTED
  # For token-based auth, use the following key:
  token: REDACTED

  # For certificate-based auth, use the following keys:
  #user: etcinit
  #cert: ''
channels:
  # The feed channel is where Phabulous will post every feed event to this
  # channel. Leave it blank to disable this feature.
  #feed: '#phabricator'

  # You can map repositories to a channel. This will send feed events regarding
  # commits and revisions to the specified channel.
  #repositories:
  #  CALLSIGN: '#channel'
  #  OTHERCALLSIGN: '#otherchannel'

  # You can map projects to a channel. This will send feed events regarding
  # tasks to the specified channel.
  projects:
    17: '#development'
misc:
  ignore-ca: false
@pdilyard
Copy link
Author

Oh and I did search through the issues before posting this, and found that #22 was the same, but that it had been closed as resolved. I wanted to report that it is not resolved, at least for me.

@nornagon
Copy link

I'm also seeing this issue when trying to look up a task with lookup Txxxx

@nornagon
Copy link

Turned out my bot didn't have permissions to view that task.

@pdilyard
Copy link
Author

I've tried making my bot an administrator and I still get the same error. For me, it is also not specific to lookup Txxx

@etcinit
Copy link
Owner

etcinit commented Mar 22, 2016

Hm. I'll try to give this a look soon. There are multiple reasons why this could be happening, like authorization or API changes. The main problem being that Gonduit did not got the expected response from Phabricator. Gonduit definitely needs some work on how it reports these issues. I'll open a task for providing a copy of the API response when errors occur (etcinit/gonduit#2).

@etcinit
Copy link
Owner

etcinit commented Apr 20, 2016

Ok, the issue seems to be that Phabricator returns an empty array/object when the response is empty. Golang's JSON decoder parses this as an array, which cannot be converted to a map, hence the error above.

I have a fix on the works (ccfabc9) but I need to experiment a bit more.

Empty responses seem to happen when the bot doesn't have access to an object or the object simply does not exist.

@etcinit
Copy link
Owner

etcinit commented Apr 20, 2016

Relevant Gonduit commit: etcinit/gonduit@162817d

@schemar
Copy link
Collaborator

schemar commented Mar 12, 2018

This should be fixed in the upcoming 3.0.0 release.

@schemar schemar closed this as completed Mar 12, 2018
@berkus
Copy link
Contributor

berkus commented Mar 22, 2018

Thanks!

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