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

Copy formatted for exception does not work #301

Closed
kesselb opened this issue Dec 23, 2019 · 5 comments
Closed

Copy formatted for exception does not work #301

kesselb opened this issue Dec 23, 2019 · 5 comments

Comments

@kesselb
Copy link

kesselb commented Dec 23, 2019

Steps to reproduce

  1. Go to logreader
  2. See a exception
  3. Try to use copy formatted

Peek 2019-12-23 18-12

{"reqId":"UzJRWUoAh7Q8hsDHP4Z1","level":3,"time":"2019-12-23T17:10:13+00:00","remoteAddr":"192.168.10.1","user":"admin","app":"workflow_pdf_converter","method":"GET","url":"/apps/accessibility/js/accessibility?v=0","message":{"Exception":"RuntimeException","Message":"App class OCA\\WorkflowPDFConverter\\AppInfo\\Application is not setup via query() but directly","Code":0,"Trace":[{"file":"/home/vagrant/nextcloud-extra-apps/workflow_pdf_converter/lib/AppInfo/Application.php","line":36,"function":"__construct","class":"OCP\\AppFramework\\App","type":"->"},{"file":"/home/vagrant/code/nextcloud/lib/private/ServerContainer.php","line":107,"function":"__construct","class":"OCA\\WorkflowPDFConverter\\AppInfo\\Application","type":"->"},{"file":"/home/vagrant/code/nextcloud/lib/private/ServerContainer.php","line":133,"function":"getAppContainer","class":"OC\\ServerContainer","type":"->"},{"file":"/home/vagrant/nextcloud-extra-apps/workflow_pdf_converter/appinfo/app.php","line":24,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":265,"args":["/home/vagrant/nextcloud-extra-apps/workflow_pdf_converter/appinfo/app.php"],"function":"require_once"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":155,"function":"requireAppFile","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":128,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/lib/base.php","line":993,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/index.php","line":38,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/vagrant/code/nextcloud/lib/public/AppFramework/App.php","Line":80,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/79.0.3945.79 Chrome/79.0.3945.79 Safari/537.36","version":"18.0.0.6"}
{"reqId":"UzJRWUoAh7Q8hsDHP4Z1","level":3,"time":"2019-12-23T17:10:13+00:00","remoteAddr":"192.168.10.1","user":"admin","app":"workflow_script","method":"GET","url":"/apps/accessibility/js/accessibility?v=0","message":{"Exception":"RuntimeException","Message":"App class OCA\\WorkflowScript\\AppInfo\\Application is not setup via query() but directly","Code":0,"Trace":[{"file":"/home/vagrant/nextcloud-extra-apps/workflow_script/lib/AppInfo/Application.php","line":36,"function":"__construct","class":"OCP\\AppFramework\\App","type":"->"},{"file":"/home/vagrant/nextcloud-extra-apps/workflow_script/appinfo/app.php","line":24,"function":"__construct","class":"OCA\\WorkflowScript\\AppInfo\\Application","type":"->"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":265,"args":["/home/vagrant/nextcloud-extra-apps/workflow_script/appinfo/app.php"],"function":"require_once"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":155,"function":"requireAppFile","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":128,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/lib/base.php","line":993,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/index.php","line":38,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/vagrant/code/nextcloud/lib/public/AppFramework/App.php","Line":80,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/79.0.3945.79 Chrome/79.0.3945.79 Safari/537.36","version":"18.0.0.6"}
{"reqId":"UzJRWUoAh7Q8hsDHP4Z1","level":3,"time":"2019-12-23T17:10:13+00:00","remoteAddr":"192.168.10.1","user":"admin","app":"workflowengine","method":"GET","url":"/apps/accessibility/js/accessibility?v=0","message":{"Exception":"RuntimeException","Message":"App class OCA\\WorkflowEngine\\AppInfo\\Application is not setup via query() but directly","Code":0,"Trace":[{"file":"/home/vagrant/code/nextcloud/apps/workflowengine/lib/AppInfo/Application.php","line":45,"function":"__construct","class":"OCP\\AppFramework\\App","type":"->"},{"file":"/home/vagrant/code/nextcloud/lib/private/ServerContainer.php","line":107,"function":"__construct","class":"OCA\\WorkflowEngine\\AppInfo\\Application","type":"->"},{"file":"/home/vagrant/code/nextcloud/lib/private/ServerContainer.php","line":133,"function":"getAppContainer","class":"OC\\ServerContainer","type":"->"},{"file":"/home/vagrant/code/nextcloud/apps/workflowengine/appinfo/app.php","line":25,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":265,"args":["/home/vagrant/code/nextcloud/apps/workflowengine/appinfo/app.php"],"function":"require_once"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":155,"function":"requireAppFile","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/lib/private/legacy/app.php","line":128,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/lib/base.php","line":993,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/home/vagrant/code/nextcloud/index.php","line":38,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/vagrant/code/nextcloud/lib/public/AppFramework/App.php","Line":80,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/79.0.3945.79 Chrome/79.0.3945.79 Safari/537.36","version":"18.0.0.6"}

Expected behaviour

Exception copied

Actual behaviour

Nothing

@Bubu
Copy link

Bubu commented Apr 18, 2020

I just noticed this as well. I get a TypeError: e.args is undefined in the webbrowser console.

@jknockaert
Copy link

I'm hitting the same issue. The error only happens when the stack is dumped to the log; i.e. for log entries without php stack the error doesn't happen.
@icewind1991 can you have a look into this? I think the bug is somewhere in the code you added in 2019.

@jknockaert
Copy link

OK, I think I found the error. The raw log message is formatted as json. To reformat it some logic will parse the json message. Part of the json message is the Trace element which has the format of the list. Each element of that list is a dictionary which may or may not have an args element. When the args element is missing, an error results upon Copy formatted. I have no javascript experience so it is just my best guess the error happens here:

const args = trace.args.map(arg => {

So somewhere this should be caught, perhaps by adding an empty list to the Trace elements for which args is missing. Perhaps in the parse function?
parse (logMessage) {

@radoeka
Copy link

radoeka commented Apr 5, 2021

I encountered this issue as well.
Can it be fixed, as makes it more difficult to provide information to the Nextcloud developers.

@jknockaert
Copy link

@icewind1991 Can you have a look at this? I think I identified the code that causes the error (see above).

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

No branches or pull requests

4 participants