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

gcloud beta emulators pubsub : "Unknown request URI " #210

Closed
stephenplusplus opened this issue Feb 8, 2016 · 6 comments
Closed

gcloud beta emulators pubsub : "Unknown request URI " #210

stephenplusplus opened this issue Feb 8, 2016 · 6 comments
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@stephenplusplus
Copy link

From @SteelzZ on February 8, 2016 18:36

I have gcloud in docker container and running pubsub emulator inside.

Trying to create topic:

ctx := context.Background()
client := oauth2.NewClient(ctx, nil)
service, _ := pubsub.New(client)
service.BasePath = "http://192.168.99.100:8082/"
topic, _ := service.Projects.Topics.Create(fullTopicName("xxxx", "some-topic"), &pubsub.Topic{}).Do()

As response i get 404:

googleapi: got HTTP response code 404 with body: Not Found

And in pubsub logs i see:

pubsub] Feb 08, 2016 6:02:16 PM com.google.cloud.pubsub.testing.v1.GrpcServer$3 operationComplete
[pubsub] INFO: Adding handler(s) to newly registered Channel.
[pubsub] Feb 08, 2016 6:02:16 PM com.google.cloud.pubsub.testing.v1.HttpVersionRoutingHandler channelRead
[pubsub] INFO: Detected non-HTTP/2 connection.
[pubsub] Feb 08, 2016 6:02:16 PM com.google.cloud.pubsub.testing.v1.NotFoundHandler handleRequest
[pubsub] INFO: Unknown request URI: http://192.168.99.100:8082/v1/projects/xxxx/topics/some-topic?alt=json

But if do a pure curl request, it works:

curl -X PUT http://192.168.99.100:8082/v1/projects/xxxx/topics/some-topic?alt=json
{
  "name": "projects/xxxx/topics/some-topic"
}

Was trying to dig in and figured out that disabling this solves issue, but not sure if that is a problem.

Perhaps it relates somehow to this golang issue ? And this check here ?

Ideas?

Copied from original issue: GoogleCloudPlatform/gcloud-common#87

@okdave
Copy link
Contributor

okdave commented Feb 8, 2016

@SteelzZ it's strange that commenting out the SetOpaque line changes anything; after all the URL that the pubsub emulator is logging looks valid to me. The 4860 issue should be unrelated: the issue was closed 3 years ago (and we should just delete the workaround code now).

As far as I can tell from your URLs there are no hex-encoded characters in your URL (your topic and project identifiers are alphanum words). Is that right?

@SteelzZ
Copy link

SteelzZ commented Feb 9, 2016

@okdave Ok so when SetOpaque is disabled in wireshark i can see this:

Frame 6: 274 bytes on wire (2192 bits), 274 bytes captured (2192 bits) on interface 0
Ethernet II, Src: 0a:00:27:00:00:00 (0a:00:27:00:00:00), Dst: CadmusCo_be:6c:a6 (08:00:27:be:6c:a6)
Internet Protocol Version 4, Src: 192.168.99.1, Dst: 192.168.99.100
Transmission Control Protocol, Src Port: 62078 (62078), Dst Port: 8082 (8082), Seq: 1, Ack: 1, Len: 208
Hypertext Transfer Protocol
    PUT /v1/projects/xxx/topics/ggggggg-topic?alt=json HTTP/1.1\r\n
        [Expert Info (Chat/Sequence): PUT /v1/projects/xxx/topics/ggggggg-topic?alt=json HTTP/1.1\r\n]
            [PUT /v1/projects/xxx/topics/ggggggg-topic?alt=json HTTP/1.1\r\n]
            [Severity level: Chat]
            [Group: Sequence]
        Request Method: PUT
        Request URI: /v1/projects/xxx/topics/ggggggg-topic?alt=json
        Request Version: HTTP/1.1
    Host: 192.168.99.100:8082\r\n
    User-Agent: google-api-go-client/0.5\r\n
    Content-Length: 3\r\n
    Content-Type: application/json\r\n
    Accept-Encoding: gzip\r\n
    \r\n
    [Full request URI: http://192.168.99.100:8082/v1/projects/xxx/topics/ggggggg-topic?alt=json]
    [HTTP request 1/1]
    [Response in frame: 8]
JavaScript Object Notation: application/json

And when SetOpaque is enabled:

Frame 29: 300 bytes on wire (2400 bits), 300 bytes captured (2400 bits) on interface 0
Ethernet II, Src: 0a:00:27:00:00:00 (0a:00:27:00:00:00), Dst: CadmusCo_be:6c:a6 (08:00:27:be:6c:a6)
Internet Protocol Version 4, Src: 192.168.99.1, Dst: 192.168.99.100
Transmission Control Protocol, Src Port: 62098 (62098), Dst Port: 8082 (8082), Seq: 1, Ack: 1, Len: 234
Hypertext Transfer Protocol
    PUT http://192.168.99.100:8082/v1/projects/nildev/xxx/ggggggg-topic?alt=json HTTP/1.1\r\n
        [Expert Info (Chat/Sequence): PUT http://192.168.99.100:8082/v1/projects/xxx/topics/ggggggg-topic?alt=json HTTP/1.1\r\n]
            [PUT http://192.168.99.100:8082/v1/projects/xxx/topics/ggggggg-topic?alt=json HTTP/1.1\r\n]
            [Severity level: Chat]
            [Group: Sequence]
        Request Method: PUT
        Request URI: http://192.168.99.100:8082/v1/projects/nildev/xxx/ggggggg-topic?alt=json
        Request Version: HTTP/1.1
    Host: 192.168.99.100:8082\r\n
    User-Agent: google-api-go-client/0.5\r\n
    Content-Length: 3\r\n
    Content-Type: application/json\r\n
    Accept-Encoding: gzip\r\n
    \r\n
    [Full request URI: http://192.168.99.100:8082http://192.168.99.100:8082/v1/projects/xxx/topics/ggggggg-topic?alt=json]
    [HTTP request 1/1]
    [Response in frame: 31]
JavaScript Object Notation: application/json

As you see request URI has whole schema://host:port prepended.

@okdave
Copy link
Contributor

okdave commented Feb 9, 2016 via email

@hbchai
Copy link

hbchai commented Feb 13, 2016

This is definitely a bug in the emulator. A fix is in the works.

@okdave okdave added the api: pubsub Issues related to the Pub/Sub API. label Feb 16, 2016
@hbchai
Copy link

hbchai commented Mar 14, 2016

This should be fixed as of SDK 98, released about 3 weeks ago.

@broady broady closed this as completed Mar 17, 2016
@broady
Copy link
Contributor

broady commented Mar 17, 2016

Verified working now.

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants