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

When running AMI LoD twig extension via Hydroponics we have no request domain/failure #199

Open
DiegoPino opened this issue May 10, 2024 · 0 comments
Labels
API CURLing your way into hell bug Something isn't working Drupal 10 LoD Reconciliation Make your labels into Links and suffer Twig Extension Extend too much and the wood might break
Milestone

Comments

@DiegoPino
Copy link
Member

DiegoPino commented May 10, 2024

What?

New to me. But might have happened before too. Might also be a Drupal 10 change because I remember ingesting with AMI LOD Twig extensions via background hydroponics.

But the error exists now

GuzzleHttp\Exception\RequestException thrown in /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:211 while querying for @entity_type entity ids matching "Author". Message: cURL error 3: URL rejected: Port number was not a decimal number between 0 and 65535 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for ://:8001/webform_strawberry/auth_autocomplete/loc/relators?_format=json&q=Author

Which happens at

\Drupal\ami\TwigExtension::amiLodReconcile

when we request the current domain to initialize the controller manually

Here:

 try {
      $domain = \Drupal::service('request_stack')->getCurrentRequest()->getSchemeAndHttpHost();
     // $domain ends only having the 8001 without the scheme and host. (because it is detached.)
      $lod_route_argument_list = explode(";", $vocab);
      $lod = \Drupal::service('ami.lod')->invokeLoDRoute($domain,
        $label, $lod_route_argument_list[0],
        $lod_route_argument_list[1], $lod_route_argument_list[2], $len ?? 'en', 1);
    }

The solution here is either to use the internal esmero-web when running on background (which brings an issue with cookies/sessions) or do something totally different

    $controller = $this->classResolver->getInstanceFromDefinition('\Drupal\my_module\Controller\MyController');
    return $controller->build();

Where we initialize the controller not by invoking the route, but via a class resolver/instance from the code directly

@alliomeria this is an issue for our huge background ingests so will have to tackle tomorrow early AM (will try)

@DiegoPino DiegoPino added bug Something isn't working LoD Reconciliation Make your labels into Links and suffer Twig Extension Extend too much and the wood might break API CURLing your way into hell Drupal 10 labels May 10, 2024
@DiegoPino DiegoPino added this to the 0.8.0 milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API CURLing your way into hell bug Something isn't working Drupal 10 LoD Reconciliation Make your labels into Links and suffer Twig Extension Extend too much and the wood might break
Projects
None yet
Development

No branches or pull requests

1 participant