Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9002

New Admin UI's File screen cannot display JSON and TXT files

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.2, 7.0
    • Component/s: None
    • Labels:
      None

      Description

      Default cloud example. Looking at the params.json file in the New Admin UI shows empty screen and an Angular stack trace in the console.

      "Error: [$sce:itype] Attempted to trust a non-string value in a content requiring a string: Context: html
      http://errors.angularjs.org/1.3.8/$sce/itype?p0=html
      minErr/<@http://localhost:6001/solr/libs/angular.js:86:12
      trustAs@http://localhost:6001/solr/libs/angular.js:15167:1
      @http://localhost:6001/solr/libs/angular.js:15918:16
      $parseFilter@http://localhost:6001/solr/libs/angular.js:12168:14
      regularInterceptedExpression@http://localhost:6001/solr/libs/angular.js:12855:21
      expressionInputsWatch@http://localhost:6001/solr/libs/angular.js:12783:24
      $RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:6001/solr/libs/angular.js:14240:34
      $RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:6001/solr/libs/angular.js:14511:13
      timeout/timeoutId<@http://localhost:6001/solr/libs/angular.js:16237:25
      completeOutstandingRequest@http://localhost:6001/solr/libs/angular.js:4925:7
      Browser/self.defer/timeoutId<@http://localhost:6001/solr/libs/angular.js:5305:7
      "
      

      The same functionality works in the old Admin UI.

      1. SOLR-9002.patch
        0.5 kB
        Upayavira
      2. SOLR-9002.patch
        2 kB
        Upayavira
      3. SOLR-9002.patch
        2 kB
        Upayavira
      4. SOLR-9002.patch
        2 kB
        Upayavira
      5. json file blank screen.png
        391 kB
        Alexandre Rafalovitch

        Issue Links

          Activity

          Hide
          upayavira Upayavira added a comment -

          Where are you looking at the "params.json" file? I'm not aware of such a file in Solr. Which tab are you using that throws the error?

          Show
          upayavira Upayavira added a comment - Where are you looking at the "params.json" file? I'm not aware of such a file in Solr. Which tab are you using that throws the error?
          Hide
          arafalov Alexandre Rafalovitch added a comment -

          It is out of the box *bin/solr start -e cloud example".

          Show
          arafalov Alexandre Rafalovitch added a comment - It is out of the box *bin/solr start -e cloud example".
          Hide
          upayavira Upayavira added a comment -

          AngularJS by default detects JSON and parses it. Thus, anything else (XML/HTML/text/etc) would come through as a string, but JSON would be parsed into Javascript objects, causing this error.

          The attached patch prevents Angular's JSON parsing functionality, meaning JSON files are now displayed correctly in the Files tab.

          Show
          upayavira Upayavira added a comment - AngularJS by default detects JSON and parses it. Thus, anything else (XML/HTML/text/etc) would come through as a string, but JSON would be parsed into Javascript objects, causing this error. The attached patch prevents Angular's JSON parsing functionality, meaning JSON files are now displayed correctly in the Files tab.
          Hide
          arafalov Alexandre Rafalovitch added a comment -

          This works in my test. However, the JSON output is not highlighted like the other formats (e.g. XML) are. Interestingly, Cloud/Tree screen that looks directly into Zookeeper works fine and does do highlighting.

          Show
          arafalov Alexandre Rafalovitch added a comment - This works in my test. However, the JSON output is not highlighted like the other formats (e.g. XML) are. Interestingly, Cloud/Tree screen that looks directly into Zookeeper works fine and does do highlighting.
          Hide
          upayavira Upayavira added a comment -

          Patch that fixes JSON syntax highlighting

          Show
          upayavira Upayavira added a comment - Patch that fixes JSON syntax highlighting
          Hide
          arafalov Alexandre Rafalovitch added a comment -

          Highlight is working now, but the color scheme does not match either old format or the one in Zookeeper tree view.

          The issue seems the CSS class. The patch causes it to be "language-javascript", where the other two examples use "language-json".

          Show
          arafalov Alexandre Rafalovitch added a comment - Highlight is working now, but the color scheme does not match either old format or the one in Zookeeper tree view. The issue seems the CSS class. The patch causes it to be "language-javascript", where the other two examples use "language-json".
          Hide
          upayavira Upayavira added a comment -

          Better now?

          Show
          upayavira Upayavira added a comment - Better now?
          Hide
          arafalov Alexandre Rafalovitch added a comment -

          Uhm. The patch looks identical to the previous one.... Wrong export?

          Show
          arafalov Alexandre Rafalovitch added a comment - Uhm. The patch looks identical to the previous one.... Wrong export?
          Hide
          upayavira Upayavira added a comment -

          Another try

          Show
          upayavira Upayavira added a comment - Another try
          Hide
          arafalov Alexandre Rafalovitch added a comment -

          Looks great. Ready to go, I believe.

          Show
          arafalov Alexandre Rafalovitch added a comment - Looks great. Ready to go, I believe.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user arafalov opened a pull request:

          https://github.com/apache/lucene-solr/pull/60

          SOLR-9002: Patch against latest master

          Upayavira's patch applied (cleanly) against latest master and tested. It works correctly and does not seem to break other views.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/arafalov/lucene-solr-contributions alex-SOLR-9002

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/lucene-solr/pull/60.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #60


          commit b0b4052bb6d11ca5f4e2a91359a00dd61b3068a1
          Author: Alexandre Rafalovitch <arafalov@gmail.com>
          Date: 2016-08-03T09:06:18Z

          Merge pull request #1 from apache/master

          Update to latest Apache master

          commit 8397e0c8db7f91266477632f05d39749d2b209ff
          Author: Alexandre Rafalovitch <arafalov@gmail.com>
          Date: 2016-08-03T10:12:19Z

          Upayavira's patch tested against latest master


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user arafalov opened a pull request: https://github.com/apache/lucene-solr/pull/60 SOLR-9002 : Patch against latest master Upayavira's patch applied (cleanly) against latest master and tested. It works correctly and does not seem to break other views. You can merge this pull request into a Git repository by running: $ git pull https://github.com/arafalov/lucene-solr-contributions alex- SOLR-9002 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/lucene-solr/pull/60.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #60 commit b0b4052bb6d11ca5f4e2a91359a00dd61b3068a1 Author: Alexandre Rafalovitch <arafalov@gmail.com> Date: 2016-08-03T09:06:18Z Merge pull request #1 from apache/master Update to latest Apache master commit 8397e0c8db7f91266477632f05d39749d2b209ff Author: Alexandre Rafalovitch <arafalov@gmail.com> Date: 2016-08-03T10:12:19Z Upayavira's patch tested against latest master
          Hide
          arafalov Alexandre Rafalovitch added a comment -

          The .txt files were also having an issue due to type mapping. Same outcome as in SOLR-8379, but slightly different code path.

          Show
          arafalov Alexandre Rafalovitch added a comment - The .txt files were also having an issue due to type mapping. Same outcome as in SOLR-8379 , but slightly different code path.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 97dc5a2a0bd2a00e227cb7b6621f827f64b01457 in lucene-solr's branch refs/heads/master from Alexandre Rafalovitch
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=97dc5a2 ]

          SOLR-9002: Fix type mapping for JSON and text
          This is for the Admin UI's collection/File screen

          Show
          jira-bot ASF subversion and git services added a comment - Commit 97dc5a2a0bd2a00e227cb7b6621f827f64b01457 in lucene-solr's branch refs/heads/master from Alexandre Rafalovitch [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=97dc5a2 ] SOLR-9002 : Fix type mapping for JSON and text This is for the Admin UI's collection/File screen
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 9275b417064435ef3dcf80300b631083f9fb7167 in lucene-solr's branch refs/heads/branch_6x from Alexandre Rafalovitch
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9275b41 ]

          SOLR-9002: Fix type mapping for JSON and text
          This is for the Admin UI's collection/File screen

          Show
          jira-bot ASF subversion and git services added a comment - Commit 9275b417064435ef3dcf80300b631083f9fb7167 in lucene-solr's branch refs/heads/branch_6x from Alexandre Rafalovitch [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9275b41 ] SOLR-9002 : Fix type mapping for JSON and text This is for the Admin UI's collection/File screen
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user arafalov closed the pull request at:

          https://github.com/apache/lucene-solr/pull/60

          Show
          githubbot ASF GitHub Bot added a comment - Github user arafalov closed the pull request at: https://github.com/apache/lucene-solr/pull/60
          Hide
          mikemccand Michael McCandless added a comment -

          Bulk close resolved issues after 6.2.0 release.

          Show
          mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

            People

            • Assignee:
              arafalov Alexandre Rafalovitch
              Reporter:
              arafalov Alexandre Rafalovitch
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development