healthlocker / oxleas-adhd

https://focus.headscapegreenwich.co.uk/
8 stars 0 forks source link

Internal server error on SU Tooklit #307

Closed ghost closed 6 years ago

ghost commented 6 years ago

On Evan B - I'm just getting it on the goals

On my account and bobby stapler I'm getting it on goals and coping strategies

Any thoughts @RobStallion?

RobStallion commented 6 years ago

Can you provide the log in details for those users please @katyedwards so that we can take a look at what could be causing this to happen?

ghost commented 6 years ago

Sure

evanb@email.com bob@email.com katy@mindwaveventures.com

all p/w password

RobStallion commented 6 years ago

Looked at the looks on the server for what was causing this error and saw this error message...

Request: GET /goal
** (exit) an exception was raised:
    ** (UndefinedFunctionError) function HtmlSanitizeEx.basic_html/1 is undefined (module HtmlSanitizeEx is not available)

(the error logs can be found on the server at /home/oxleasadmin/oxleas_adhd/var/log/"the_latest_log". Thanks @nelsonic for this)

This directly relates to issue #297. In order for #297 to be resolved we had to remove html_sanitize_ex from the applicaiton list in the mix.exs file.

However, it appears that edeliver uses this list to determine which dependencies can be used in the project.

A temporary solution to this issue could be to use the oxleas.script to run the code as it also runs the code in prod and does not encounter this error. However I do not think that this is a good long term solution as it would mean that every time a deployment to the server was done using edeliver; we would have to then ssh onto the server and start the application with the command for the script, systemctl start oxleas.service

@nelsonic have you ever come across an issue like this and do you have any thoughts on it?

RobStallion commented 6 years ago

After doing a bit of light reading (understanding deps and applications in your mixfile, the section on Application inference here, edeliver readme, distillery readme, distillery documentation on releases) it looks like the issue is to do with how distillery is building the release of the project.

Here is the error we get when we run the build using edeliver (which in turn uses distillery)... image

==> Including ERTS 9.0 from /usr/lib/erlang/erts-9.0
==> Generating boot script
==> Release failed, during .boot generation:
        Undefined applications: [xmerl]

However, if I run a build using just distillery on it's own I get the following...

image

  xmerl-1.3.16
    from: /usr/local/Cellar/erlang/20.2.2/lib/erlang/lib/xmerl-1.3.16
    applications:
      :kernel
      :stdlib
    includes: none

image

It appears as though when I am using just distillery it is able to find the package xmerl but when we use edeliver it cannot.

In order to see why this might be happening I have taken two screenshots of the same package being installed. The first is from the edeliver build...

image

And the second is from the distillery build... image

It appears as though they are reading their files from different paths. Going to look into why this is happening and try to get edeliver to read from the same path as distillery.

nelsonic commented 6 years ago

@RobStallion great detective work! 🔍 My advice would be to open issues/questions everywhere to get help from the creators of these modules. failing that I can help pair-debug this if you are free.

RobStallion commented 6 years ago

After looking at the file path for the edeliver build above I noticed that I do not have a path like this locally. However this exact path does exist on the server.

This leads me to believe that the issue is with edeliver not being able to find the file for xmerl on the staging server.

RobStallion commented 6 years ago

Have managed to resolve this issue now. erlang-xmerl needed to be installed on the server.

Ran the following commands on the staging server

apt-get update
apt-get install erlang-xmerl

Next time I ran the build it was successful.

Next steps

ghost commented 6 years ago

@RobStallion was the fix for this deployed? I'm still having problems this morning on goals, coping strategies and now tracking overview as soon as I have saved any tracking data.

We're going to struggle to test the 'please test' issues if we can't access stuff!

RobStallion commented 6 years ago

@katyedwards this was finished quite late on Friday night so there was not time to get it merged in then. It has been merged not too long ago now though so will do a deployment to staging.

ghost commented 6 years ago

This one seems to be sorted, but I'm getting it again on the clinician caseload :o(

Have updated that issue, but will close this one!