Cht-core: Export server logs from webapp does not work

Created on 27 Jan 2017  Â·  16Comments  Â·  Source: medic/cht-core

From @smbuthia in https://github.com/medic/medic-projects/issues/1301:

I tried exporting server logs from the web app [...] but nothing seems to happen when I click on the export button, even with the can_export_server_logs permissions set.

export

Seems related to #2694

Bug

All 16 comments

@smbuthia @abbyad Were there any errors in the JS console or API logs?

@garethbowen ,yes. I've attached below.

export-server-logs

That's perfect @smbuthia thanks! The "Internal Server Error" bit implies that it's an issue with API so there's almost certainly more information in the API logs. Can you please check there too?

Not sure if this is what you need @garethbowen but here is what I get from error-ssl.log

2017/01/29 19:04:02 [error] 949#0: *27420 connect() failed (111: Connection refused) while connecting to upstream, client: 197.237.241.xxx, server: _, request: "POST /api/v1/export/logs?format=zip&locale=en HTTP/1.1", upstream: "http://127.0.0.1:280/api/v1/export/logs?format=zip&locale=en", host: "cbhipp.dev.medicmobile.org", referrer: "https://cbhipp.dev.medicmobile.org/medic/_design/medic/_rewrite/"

No errors on medic-api logs.

There's an error in the medic-api logs:

2017-01-29T19:23:55.749Z - error: Server error:
 [Error: Log export exited with non-zero status 1]

So the log bundling script is exiting with a 0. I'm not sure if we have any more data...

Host: cbhipp.dev.medicmobile.org

Maybe it can't find the print-logs script? I can find a copy in /srv/storage/system-services/home/vm but it fails to execute directly with:

./print-logs: source: line 4: can't open '/boot/include/formatter'

@browndav Can you take a look at this?

Self-assigning this and placing it in the current sprint.

This is fixed in the current Medic OS master, and will be automatically patched as part of the upgrade process outlined in https://github.com/medic/medic-servers/blob/master/docs/package-update-checklist.md. That work is currently being tracked by https://github.com/medic/medic-webapp/issues/3110.

Root cause: merge error resulted in formatter being omitted during a release. It is now checked in at https://github.com/medic/medic-os/blob/master/platform/initrd/common/boot/include/formatter.

Was this issue specific to an instance or are we able to test it on our test instances @abbyad ? Can @smbuthia check if he can now export logs on the same instance?

I just tested this on lg.dev (latest beta) and exporting server logs isn't working. Here are the console errors I'm seeing:
image

This server would need to be upgraded for you to see a difference, and AFAICT https://github.com/medic/medic-webapp/issues/3173 is blocking that. I'll upgrade lg.dev ASAP after a resolution to medic/medic-webapp#3173 – it's the sole remaining blocker for a Medic OS release.

Ah, makes sense. I guess we can hold off on AT for now then. We can easily AT this on one of the upgraded cloned instances.

This issue is still pending/happening but has AT label. Shall we move it to ready and leave the open #3209
@garethbowen @sglangevin ?
image

Will move this one and will do full AT with #3209

This should be working on an instance with upgraded Medic OS. Where did you test?

Was this page helpful?
0 / 5 - 0 ratings