Closed Bug 1593561 Opened 6 years ago Closed 6 years ago

Search broken and list of search engines in preferences empty when the distribution directory is not readable by the current user

Categories

(Firefox :: Search, defect, P2)

70 Branch
defect
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 72
Iteration:
72.2 - Nov 4 - 17
Tracking Status
firefox72 --- fixed

People

(Reporter: rich, Assigned: standard8)

References

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

type "reason no midi" in the search/title bar.

Actual results:

I end up on some site called "reason.com".

Expected results:

I'm expecting a google search on those keywords.

Note, In preferences, there's an option to select the default search engine, but there are no options to select from. The dropdown is empty.

Firefox 70.0.1 64-bit on MacOs catalina (10.15.1)

Component: Untriaged → Search
Summary: no search? → Search broken and list of seearch engines in preferences empty

Hi Richard, we should be able to get this fixed, however please could you try doing this first to give us some debug?

  • Go back into about:config
  • Search for browser.search.log, click on the toggle to set it to true.
  • Restart the browser.
  • Go to Tools -> Web Developer -> Browser Console (not the web console).
  • Right-click and select Select All
  • Right-click again, and select Copy message
  • Paste that into a file and attach it to this bug.

Once you've done that, lets try and fix it:

  • Please go to Help -> Troubleshooting Information.
  • In the Application Basics section, next to Profile Folder select the Show in Finder button.
  • Double click the selected folder.
  • Shut down Firefox
  • Find and rename (or move to a different location) the file search.json.mozlz4 (please keep a copy, I'd like you to attach it as well).
  • Then start up Firefox again.

Hopefully that should get you working. If it doesn't a second copy of the log might be useful.

Please attach the search.json.mozlz4 file - that only contains details about which search engines you have/had installed, and what gets displayed.

Assuming that all works, you might want to set browser.search.log back to false. There shouldn't be a big performance impact with it, but it is probably better in the long term to leave it at the default.

Flags: needinfo?(rich)

Sorry. I already fixed it by completely removing the app, then downloading and installing a fresh copy. This seems to have worked but means that I no longer have the failing system to which to refer.

Flags: needinfo?(rich)
Attached file search.json.mozlz4

I'm seeing same exact issue. Completely reinstalling the app only fixed the issue temporarily as it shortly reappeared again.

Mark, I tried (re)moving search.json.mozlz4 file and that didn't help to fix the issue. Please see the file along with browser console logs attached in the ticket.

Specs:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:70.0.1) Gecko/20100101 Firefox/70.0.1
Note that I have Firefox installed as a brew cask using brew cask install firefox (wonder if there's something to do with permissions here but not sure).

Let me know if there's anything else I can do to debug the issue.

Thanks,
Kirill

Flags: needinfo?(standard8)

Thanks Kirill,

I think your issue might be slightly different to Richard's, but lets run with it anyway. The most interesting part of the log is this:

_init: failure initializng search: Unix error 13 during operation DirectoryIterator on file /Applications/Firefox.app/Contents/Resources/distribution/searchplugins/common (Permission denied)

The distribution directory shouldn't be part of a standard Firefox install, and I can't see that homebrew would have created it. I'm also not sure that we've changed that code recently. Hence, I'm a little puzzled.

Please could you have a look at the distribution directory tree, and see what the various permissions are and what's in it?

I think we could probably work around this in code, but I'd like to see if we can work out what's created that and why.

Flags: needinfo?(standard8) → needinfo?(kirill.zhukov)
Summary: Search broken and list of seearch engines in preferences empty → Search broken and list of search engines in preferences empty

Also, do you have a distribution.ini anywhere within /Applications/Firefox.app/ ? If so, I think it would be useful to if you could attach that as well.

Hey Mark,

distribution directory only contains policies.json, it has rw------- permissions and root user owns it, not the user that I'm logged as (could be created by my employer automatically somehow, no clue). The content of the file doesn't seem too interesting:

{
  "policies": {
    "DNSOverHTTPS": {
      "Enabled": false,
      "Locked": true
    },
    "DisableSecurityBypass": {
      "SafeBrowsing": true
    },
    "DontCheckDefaultBrowser": true,
    "Extensions": {
      "Install": [],
      "Locked": [],
      "Uninstall": []
    },
    "FlashPlugin": {
      "Default": false,
      "Locked": true
    }
  }
}

I did not find distribution.ini (or anything else with "distribution" word in it) anywhere in the /Applications/Firefox.app/ directory.
All of that being said, my issue still persists - search engines are gone and I can't use search for anything. Is there anything else I can do to help you debug the issue?

Thank

Flags: needinfo?(kirill.zhukov) → needinfo?(standard8)

Hi,

(In reply to kirill.zhukov from comment #8)

distribution directory only contains policies.json, it has rw------- permissions and root user owns it, not the user that I'm logged as (could be created by my employer automatically somehow, no clue). The content of the file doesn't seem too interesting:
...
I did not find distribution.ini (or anything else with "distribution" word in it) anywhere in the /Applications/Firefox.app/ directory.

Thanks for that, I think we can safely assume that's your employer and nothing malicious. I'm guessing that the distribution directory is also root read-only?

All of that being said, my issue still persists - search engines are gone and I can't use search for anything. Is there anything else I can do to help you debug the issue?

The quick fix will be to get your employer (unless you can) to change the permissions of the distribution directory to rwxr-xr-x and the policies.json to rw-r--r-- - then your user where you're running Firefox will actually be able to read it. That's also the main fix, as the current setup is wrong, as policies.json won't be being applied because Firefox won't be able to read it.

For the longer term fix, I think we need to make Firefox more resilient to an unreadable directory structure here. The only thing I want to check is that we'll be consistent with how we handle the result.

Assignee: nobody → standard8
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(standard8)
Priority: -- → P2
Summary: Search broken and list of search engines in preferences empty → Search broken and list of search engines in preferences empty when the distribution directory is read-only

I just did some testing, creating a distribution directory with permissions drwx------ is enough to trigger this.

A policies.json file being unreadable by the account running Firefox leads to Enterprise Policies: Error reading file on the error console, and no policies applied. I think we can probably do the same here. There's no point in stopping things working because of a broken set-up.

Points: --- → 2
Summary: Search broken and list of search engines in preferences empty when the distribution directory is read-only → Search broken and list of search engines in preferences empty when the distribution directory is not readable by the current user
Iteration: --- → 72.2 - Nov 4 - 17
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dc40e210b05d Ensure the search service can still run if the distribution directory is unreadable by the current user. r=mikedeboer
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: