capedwarf / capedwarf-blue

CapeDwarf Blue
41 stars 19 forks source link

TaskQueue HTTP call fails due to missing "Host" header #250

Open kerbymart opened 8 months ago

kerbymart commented 8 months ago

Description

When attempting to make an HTTP call using the TaskQueue API, the operation fails on CapeDwarf due to a missing mandatory "Host" HTTP header. This issue does not occur on Google App Engine (GAE) SDK, indicating a specific problem with CapeDwarf's handling of HTTP headers in TaskQueue operations.

Error Message

Couldn't find the mandatory "Host" HTTP header.

This is followed by a NullPointerException in ServletCall.java:370.

Code Snippet

The error occurs when executing a basic TaskQueue operation:

Queue queue = QueueFactory.getQueue(milkID + "-queue");
String taskUrl = "/milks/" + milkID;
queue.add(TaskOptions.Builder.withUrl(taskUrl).param("param1", param1));

Workaround Attempt

A workaround involving an HTTP filter to manually set the "Host" header was attempted, but it led to further runtime errors and instability within the CapeDwarf environment.

Environment

Expected Behavior

TaskQueue operations should include all mandatory HTTP headers, including "Host", without requiring manual intervention or workarounds.

Actual Behavior

The "Host" header is missing in TaskQueue operations, leading to failed HTTP requests and errors in the application log.

Steps to Reproduce

  1. Set up a basic TaskQueue operation as shown in the code snippet.
  2. Deploy the application to CapeDwarf.
  3. Observe the error in the application logs after the TaskQueue operation is executed.

Additional Context

This issue does not occur on other platforms like GAE Legacy Cloud Runtime or AppScale, suggesting a problem with CapeDwarf's TaskQueue implementation.

kerbymart commented 8 months ago

Possible solution points:

Point 1: Ensuring the 'Host' Header is Set Point 2: Reviewing Task Request Creation

See: