Project

General

Profile

Actions

Defect #29276

closed

Autocomplete does not show anything

Added by Christian Wolf over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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

Files

responde_with_json.patch (1.41 KB) responde_with_json.patch Marius BĂLTEANU, 2019-02-03 17:18

Related issues

Is duplicate of Redmine - Patch #30818: Issues autocomplete should respond with content type jsonClosedGo MAEDA

Actions
Actions #1

Updated by Marius BĂLTEANU over 6 years 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.

Actions #2

Updated by Marius BĂLTEANU about 6 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to No feedback
Actions #3

Updated by Christian Wolf almost 6 years 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.

Actions #4

Updated by Christian Wolf almost 6 years 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.

Actions #5

Updated by Christian Wolf almost 6 years 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>

Actions #6

Updated by Marius BĂLTEANU almost 6 years ago

Christian, thanks for your deeper investigations.

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

Actions #7

Updated by Marius BĂLTEANU almost 6 years ago

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

Updated by Christian Wolf almost 6 years 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?

Actions #9

Updated by Marius BĂLTEANU almost 6 years ago

  • Assignee changed from Christian Wolf to Marius BĂLTEANU

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.

Actions #10

Updated by Marius BĂLTEANU almost 6 years ago

I've attached the patch to #30818.

Actions #11

Updated by Marius BĂLTEANU almost 6 years ago

  • Is duplicate of Patch #30818: Issues autocomplete should respond with content type json added
Actions #12

Updated by Marius BĂLTEANU almost 6 years ago

  • Assignee deleted (Marius BĂLTEANU)
Actions #13

Updated by Go MAEDA almost 6 years ago

  • Status changed from Confirmed to Closed
Actions

Also available in: Atom PDF