[SOLVED] Possible bug in CLI 8.8.0. URL with path is not honored in requests

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [X] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Requests from some requests of the CLI are sent to the domain without the folder /cms/. If that calls gets a redirect the operation fails. Example of these calls:

dev.example.com 172.16.53.1 - - [21/Apr/2022:10:04:56 +0000] “GET /api/apps HTTP/1.1”
dev.example.com 172.16.53.1 - - [21/Apr/2022:10:05:25 +0000] “GET /api/apps/homes/schemas HTTP/1.1”
dev.example.com 172.16.53.1 - - [21/Apr/2022:10:05:38 +0000] “GET /api/apps/homes/schemas HTTP/1.1”
dev.example.com 172.16.53.1 - - [21/Apr/2022:10:10:19 +0000] "GET /api/apps/homes/assets/folders?parentId=00000000-0000-0000-0000-000000000000

I have tried with configs with ending slash and without, an the results are the same:

https://www.example.com/cms
https://www.example.com/cms/

Expected behavior

Requests are made to the URL set in sq config add. (https://www.example.com/cms/). So the above requests should be:

“GET /cms/api/apps HTTP/1.1”
“GET /cms/api/apps/homes/schemas HTTP/1.1”
“GET /cms/api/apps/homes/schemas HTTP/1.1”
"GET /cms/api/apps/homes/assets/folders?parentId=00000000-0000-0000-0000-000000000000

Minimal reproduction of the problem

Use a url parameter with a path in the URL:

Ex: www.domain.com/cms/

Environment

App Name: homes

  • [X] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [VERSION]
CLI 8.8.0

Browser:

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Have you also tried the dotnet SDK? Is there the same problem?

Hello Sebastian,

I haven’t tried nor I have the time to try so :frowning:

Regards.

I have pushed a new version, you just have to wait for the CI to finish the release.

Do you have your docker setup for me that you use for testing?

Hi Sebastian, I do not have the docker file as the final Image is layered over a vanilla dot.net container. The DockerFile I use is simply

FROM docker-internal-provider-repo/srv/web/squidex-cms:dev
RUN echo “alias l=‘ls -Flash’” >> ~/.bashrc
RUN apt install -y vim
RUN apt install -y rsyslog

And I can’t get previous images Dockerfile.

But I think this is a mere CLI issue, as is the client who is asking for those URLs, it should reproduce despite the squidex version.

The best way to validate it is to launch a full sync from an working install in a subfolder and review the access logs, then you would see that some of the paths include the URLS__BASEPATH=/cms and some other dont.

Sorry but do not have a public working environment to let u test over that.

Regards.

I am going to extend the API tests now to run twice:

Once under normal path and once with a base path. The API tests use the same code as the CLI, so it should work.

I have pushed a new version and also greatly improved the tests:

  1. I run the tests against two instances of squidex now: One hosted under root path and the other with a subpath. Because the code is mainly shared with the CLI it also ensures that the CLI works.
  2. I run two small tests with puppeteer. I make screenshots of the start page and login page to compare it with some test screenshots. I use this to ensure that the assets load properly under the root folder and the sub folder.

Hello Sebastian,

Now it is working as expected. Great Job!!!

Thanks!!

1 Like