Defect #29276

Autocomplete does not show anything

Added by Christian Wolf 10 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution: Affected version:3.4.6

Description

I have the problem, that the autocomplete feature is not working when selecting other issues. This happens e.g. when I want to add an association to another issue or put something into the parent issue field.

Expected/old behavior:
I know that recently I could simply type 2-3 letters of the topic name and using a background call to the server all issues with this string were searched. I could click one and I get the corresponding issue number inserted automatically.

Actual behavior:
For a short time a waiting GIF (turning circle) is shown, when sufficiently many letters are typed in. Instead of a box with the possible values nothing is shown. So all I can do is to put the number of the issue to be referenced manually.

When looking deeper into the problem I find that the browser starts a connection to the server using ajax and gets a JSON object with the correct result of the search. It seems that this result is simply not made visible.

Unfortunately I am not familiar enough with the JS code of redmine to track this down completely. It might as well be a CSS issue that the "box" is simply hidden/overdrawn.

If needed I can give access to the server with an account to see the effect in a sandbox. Otherwise I am trying my best to help you find the issue.

Some formal informations:
I am using the git version 375c7adfe from https://github.com/redmine/redmine.

Environment:
  Redmine version                3.4.6.stable
  Ruby version                   2.5.1-p57 (2018-03-29) [x86_64-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.10.0
  Mercurial                      4.6.2
  Bazaar                         2.7.0
  Git                            2.18.0
  Filesystem                     
Redmine plugins:
  periodictask                   3.2.1
  redhopper                      1.0.10
  redmine_auto_resubmission      1.0.2
  redmine_custom_css             0.1.7
  redmine_drawio                 0.8.2
  redmine_private_wiki           0.2.0
  redmine_shortcuts              0.0.2
  redmine_wiki_lists             0.0.9
  wiking                         1.1.0

responde_with_json.patch Magnifier (1.41 KB) Marius BALTEANU, 2019-02-03 17:18


Related issues

Duplicates Redmine - Patch #30818: Issues autocomplete should respond with content type json Closed

History

#1 Updated by Marius BALTEANU 10 months ago

  • Status changed from New to Needs feedback
  • Assignee set to Christian Wolf

Please try without any plugin because the auto complete feature works as expected in the latest releases. Also, after removing the plugins, you should restart your webserver and clear your browser cache.

#2 Updated by Marius BALTEANU 8 months ago

  • Status changed from Needs feedback to Closed
  • Resolution set to No feedback

#3 Updated by Christian Wolf 4 months ago

  • Status changed from Closed to Reopened

I am sorry for not having answered. I missed the email somehow. Sorry.

In the meantime I changed some of my infrastructure: I use now docker in order to have a simple way of keeping the compatible versions of various dependencies together. I use the docker image called redmine:3-passenger. The current system information is here:

Environment:
  Redmine version                3.4.8.stable
  Ruby version                   2.4.5-p335 (2018-10-18) [x86_64-linux]
  Rails version                  4.2.11
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.9.5
  Mercurial                      4.0
  Bazaar                         2.8.0
  Git                            2.11.0
  Filesystem                     
Redmine plugins:
  no plugin installed

I removed all plugins (temporaryly moving all folders from the `plugin` folder elsewhere) and restarted the ruby server (passenger docker container). Same result as before: Adding a parent project issues a search on the server but nothing is displayed on the frontend. The web developer tools proove that the data has been sent and that the corresponding issue has been returned in a JSON object.

Interesting enough, if I dig a tunnel to the docker instance using ssh port forwarding, it seems to work. So the problem is somewhere related to my reverse proxy in front of redmine in order to provide SSL encrypted communication.

Comparing the two different cases, I see that without the proxy, the answer is rendered and recognized as JSON while the same data seems to be unrecognized by the browser when using a reverse proxy. The only difference, I could find is the Content-Encoding: It is gzip for the direct tunnel and not existend for the proxied version.

#4 Updated by Christian Wolf 4 months ago

I just found something useful, that might cause the problem:

The JSON object is sent with Content-Type: text/html. Correct would be application/json. As a result the reverse proxy (apache 2.4) tries to be smart and "correct" malformed HTML code. As the content is marked as HTML by the passenger server, this corrections will apply and this might cause the problems.

I will try to reconfigure apache as a workaround but this should be solved anyways.

#5 Updated by Christian Wolf 4 months ago

I got it running but it is not a nice way as I needed to hack into the apache config (see here).

For those running in similar issues:

<Location "/(?!issues/auto_complete)">
        ProxyHTMLEnable On
        ProxyHTMLExtended On
</Location>

<Location "/issues/auto_complete">
        Header edit Content-Type text/html application/json
</Location>

#6 Updated by Marius BALTEANU 4 months ago

Christian, thanks for your deeper investigations.

Can you apply the attached patch and tell me if fixes the problem?

#7 Updated by Marius BALTEANU 4 months ago

  • Status changed from Reopened to Confirmed
  • Resolution deleted (No feedback)

#8 Updated by Christian Wolf 3 months ago

Dear Marius, thanks for your patch.

Indeet, it seems to have fixed the problem. I reset temporarily the apache configuration and the autocomplete worked out of the box with the patch applied.

Just one question: In which verion(s) of redmine will the patch be included? Only the 4.x or 3.4 as well?

#9 Updated by Marius BALTEANU 3 months ago

  • Assignee changed from Christian Wolf to Marius BALTEANU

Christian Wolf wrote:

Dear Marius, thanks for your patch.

Indeet, it seems to have fixed the problem. I reset temporarily the apache configuration and the autocomplete worked out of the box with the patch applied.

Just one question: In which verion(s) of redmine will the patch be included? Only the 4.x or 3.4 as well?

I'll post the complete patch these days and we'll see from there.

#10 Updated by Marius BALTEANU 3 months ago

I've attached the patch to #30818.

#11 Updated by Marius BALTEANU 3 months ago

  • Duplicates Patch #30818: Issues autocomplete should respond with content type json added

#12 Updated by Marius BALTEANU 3 months ago

  • Assignee deleted (Marius BALTEANU)

#13 Updated by Go MAEDA 3 months ago

  • Status changed from Confirmed to Closed

Also available in: Atom PDF