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

Autocomplete works locally but not on my production application #25

Closed
stochastic-thread opened this issue Jul 25, 2015 · 4 comments
Closed

Comments

@stochastic-thread
Copy link

Hello,

Locally I am able to type in queries in my local development environment while phoenix server is running, and everything works as expected. However in production, when I type any queries, I get this error message:

[info] Sent 500 in 30ms
[error] #PID<0.470.0> running Trophus.Endpoint terminated
Server: www.trophus.com:80 (http)
Request: GET /get_nearest?query=joe
** (exit) an exception was raised:
    ** (ArgumentError) argument error
        (erlastic_search) src/erls_resource.erl:67: :erls_resource.do_request/6
        (trophus) web/controllers/search_controller.ex:11: Trophus.SearchController.get_nearest/2
        (trophus) web/controllers/search_controller.ex:1: Trophus.SearchController.phoenix_controller_pipeline/2
        (trophus) lib/phoenix/router.ex:281: Trophus.Router.dispatch/2
        (trophus) web/router.ex:1: Trophus.Router.do_call/2
        (trophus) lib/trophus/endpoint.ex:1: Trophus.Endpoint.phoenix_endpoint_pipeline/1
        (trophus) lib/plug/debugger.ex:90: Trophus.Endpoint."call (overridable 3)"/2
        (trophus) lib/phoenix/endpoint/render_errors.ex:34: Trophus.Endpoint.call/2

Do you have any thoughts on what this could be due to? Thanks in advance!

@stochastic-thread
Copy link
Author

The three critical lines for me are these:

    elastic_instance = ErlasticSearch.erls_params(host: "104.131.XYZ.ABC")      
    name_result = :erlastic_search.search(elastic_instance, "trophus", "name:#{query}*")  
    desc_result = :erlastic_search.search(elastic_instance, "trophus", "description:#{query}*")

These lines work when I use them in my production environment through iex -S mix but not in the application itself. Even more confused now that I can actually make it work in that environment.

@tsloughter
Copy link
Owner

How are you connecting? What do you mean by "autocomplete"?

@stochastic-thread
Copy link
Author

Nvm I figured this issue out, no information yet but I will be sure to include it at some point (wrote myself a reminder to add soon). Please give me a day or so to append info without closing the issue. (<3)

@bryanhuntesl
Copy link
Collaborator

@stochastic-threat - it's been 1163 days - might be time to close this issue.

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

No branches or pull requests

3 participants