Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'anon-view' KeyError #724

Merged
merged 1 commit into from
Apr 18, 2022
Merged

Fix 'anon-view' KeyError #724

merged 1 commit into from
Apr 18, 2022

Conversation

glitsj16
Copy link
Contributor

Fix for #723.

@benbusby benbusby merged commit ca80bb0 into benbusby:main Apr 18, 2022
benbusby added a commit that referenced this pull request Apr 20, 2022
The "anon-view" translation key is the correct one to use for accessing
anonymous view within the search results. "config-anon-view" is only for
the configuration menu on the home page.
@benbusby
Copy link
Owner

Hey @glitsj16, I just reverted this change in 7688c1a because the "anon-view" key is actually the correct value to use in search results. "config-anon-view" should only be used on the home page config menu. Can you re-try with the latest code and see if you're still getting the error? If so, could you also share which language you have configured for your instance?

@glitsj16
Copy link
Contributor Author

Hi @benbusby. I've done another test. My configured language in whoogle.env is WHOOGLE_CONFIG_LANGUAGE=lang_en (as it has always been). Without referencing WHOOGLE_CONFIG_ANON_VIEW in my whoogle.env my instance is running without errors. As soon as I set WHOOGLE_CONFIG_ANON_VIEW=1 the formerly reported error is thrown after running a search. The web interface shows

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

and on the server I can see the exact same error message as before...

It still does so after upgrading my instance to the latest git code. Perhaps I made a mistake in setting the relevant env var, not sure. I used GH search and can only see that env var in config.py. Hope this clears up what I reported before. Feel free to ask if there's anything else I can do to help.

@benbusby
Copy link
Owner

Hmmm, that's very strange. Could you do a quick sanity check to see if app/static/settings/translations.json contains the "anon-view" key on your end? I can't figure out why that one key doesn't appear for you, especially since apparently "config-anon-view" works for you, which was part of the same commit to that file. I'm wondering if there's an issue with pulling the correct translation mapping, but if your language is set to lang_en then it shouldn't be a problem...

I'll keep looking into it as well. Could you also see if enabling anonymous view from the home page config also causes the problem if WHOOGLE_CONFIG_ANON_VIEW is not set in whoogle.env?

@glitsj16
Copy link
Contributor Author

Very strange indeed. During the weekend I have some more time to investigate what could be causing this on my end. For now I can confirm the sanity check: "config-anon-view": "Show Anonymous View Links", is contained in app/static/settings/translations.json. When enabling anonymous view from the home page (without setting WHOOGLE_CONFIG_ANON_VIEW) I get the same behavior: internal server error... I really appreciate your efforts to get to the bottom of it and will report back here tomorrow or sunday after another full reinstall of whoogle-search.

@glitsj16
Copy link
Contributor Author

@benbusby Aha, problem solved! Your last comment on translations.json did it. At first I didn't fully grasp that you were asking if I had BOTH "anon-view" and "config-anon-view" in that file. I must have missed an update or messed-up otherwise, but after a full reinstall of whoogle-search from latest git it is now working as intended on all my instances. Thanks again for looking into this and my apologies for what turned out to be 'just user error noise'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants