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

Saving note has failed #552

Closed
HuyNguyenAu opened this issue Jun 22, 2020 · 12 comments
Closed

Saving note has failed #552

HuyNguyenAu opened this issue Jun 22, 2020 · 12 comments

Comments

@HuyNguyenAu
Copy link

HuyNguyenAu commented Jun 22, 2020

Edits

  1. When a new note is created (the initial category does not seem to change the outcome), then saving works. But if a category is assigned to the note, then saving sometimes fails.
  2. Changing an existing note's category into another category still fails to save.
  3. It seems that editing the notes that failed to save on the Android Notes app seems to fix it.
  4. Update log excerpt to correct output as pointed out by korelstar.

Saving note fails
Saving a note fails when saving an existing note using CTRL + S. Newly created notes have no issue saving.

To Reproduce
Steps to reproduce the behavior:

  1. Go to an existing note.
  2. Press CTRL + S
  3. An error banner shows 'Saving note 159805 has failed. See JavaScript console and server log for details.'.

Expected behavior
When CTRL + S is pressed, the existing note should save successfully, and not errors show be shown.

Screenshots
error_note

Server:

  • Notes app version: 3.5.1
  • Nextcloud version: 18.0.6
  • OS: Ubuntu 20.04 Server LTS
  • Web server: Apache/2.4.29 (Ubuntu)
  • PHP version: PHP 7.2.24-0ubuntu0.18.04.6
  • Database: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Client:

  • Browser (incl. version): Brave Version 1.10.93 Chromium: 83.0.4103.106 (Official Build) (64-bit)
  • OS: Windows 10 10.0.18363 Build 18363

Log files
Error message from web console:
error_console
An error from Nextcloud log file:

{
    "reqId": "pnXD9yvPvU0bTdZE9RRV",
    "level": 3,
    "time": "June 23, 2020 05:54:17",
    "remoteAddr": "[removed]",
    "user": "[example_user]",
    "app": "index",
    "method": "PUT",
    "url": "/apps/notes/notes/144648",
    "message": {
        "Exception": "Exception",
        "Message": "Argument 3 passed to OCA\\Notes\\Controller\\NotesController::update() must be of the type boolean, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 170",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                "line": 125,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Notes\\Controller\\NotesController"
                    },
                    "update"
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",
                "line": 47,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": [
                    "OCA\\Notes\\Controller\\NotesController",
                    "update",
                    {
                        "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                    },
                    {
                        "id": "144648",
                        "_route": "notes.notes.update"
                    }
                ]
            },
            {
                "function": "__invoke",
                "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
                "type": "->",
                "args": [
                    {
                        "id": "144648",
                        "_route": "notes.notes.update"
                    }
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                "line": 299,
                "function": "call_user_func",
                "args": [
                    {
                        "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
                    },
                    {
                        "id": "144648",
                        "_route": "notes.notes.update"
                    }
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/base.php",
                "line": 1008,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": [
                    "/apps/notes/notes/144648"
                ]
            },
            {
                "file": "/var/www/nextcloud/index.php",
                "line": 38,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": []
            }
        ],
        "File": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 109,
        "Previous": {
            "Exception": "TypeError",
            "Message": "Argument 3 passed to OCA\\Notes\\Controller\\NotesController::update() must be of the type boolean, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 170",
            "Code": 0,
            "Trace": [
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 170,
                    "function": "update",
                    "class": "OCA\\Notes\\Controller\\NotesController",
                    "type": "->",
                    "args": [
                        "*** sensitive parameters replaced ***"
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 99,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Notes\\Controller\\NotesController"
                        },
                        "update"
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                    "line": 125,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Notes\\Controller\\NotesController"
                        },
                        "update"
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",
                    "line": 47,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::",
                    "args": [
                        "OCA\\Notes\\Controller\\NotesController",
                        "update",
                        {
                            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                        },
                        {
                            "id": "144648",
                            "_route": "notes.notes.update"
                        }
                    ]
                },
                {
                    "function": "__invoke",
                    "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
                    "type": "->",
                    "args": [
                        {
                            "id": "144648",
                            "_route": "notes.notes.update"
                        }
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                    "line": 299,
                    "function": "call_user_func",
                    "args": [
                        {
                            "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
                        },
                        {
                            "id": "144648",
                            "_route": "notes.notes.update"
                        }
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/base.php",
                    "line": 1008,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->",
                    "args": [
                        "/apps/notes/notes/144648"
                    ]
                },
                {
                    "file": "/var/www/nextcloud/index.php",
                    "line": 38,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::",
                    "args": []
                }
            ],
            "File": "/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php",
            "Line": 185
        },
        "CustomMessage": "--"
    },
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36",
    "version": "18.0.6.0"
}
@korelstar
Copy link
Member

Are you sure that the log excerpt is related? It has a timestamp February 23, 2020 02:21:37 and app is mysql.setup, not notes.

However, the screenshot shows that the server responded with an Internal Server Error. In this case, there should be some related log entries (please have a look at the entry's timestamp).

@korelstar korelstar changed the title Saving note 159805 has failed. See JavaScript console and server log for details. Saving note has failed Jun 22, 2020
@HuyNguyenAu
Copy link
Author

HuyNguyenAu commented Jun 23, 2020

It seems that NotesController::update() was given null value when it expects a boolean value.

@korelstar
Copy link
Member

Can you please post the full log entry for this error?

@HuyNguyenAu
Copy link
Author

@korelstar My bad, I've updated my original post. Is it better to post the new error or update the original post?

{
    "reqId": "pnXD9yvPvU0bTdZE9RRV",
    "level": 3,
    "time": "June 23, 2020 05:54:17",
    "remoteAddr": "[removed]",
    "user": "[example_user]",
    "app": "index",
    "method": "PUT",
    "url": "/apps/notes/notes/144648",
    "message": {
        "Exception": "Exception",
        "Message": "Argument 3 passed to OCA\\Notes\\Controller\\NotesController::update() must be of the type boolean, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 170",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                "line": 125,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Notes\\Controller\\NotesController"
                    },
                    "update"
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",
                "line": 47,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": [
                    "OCA\\Notes\\Controller\\NotesController",
                    "update",
                    {
                        "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                    },
                    {
                        "id": "144648",
                        "_route": "notes.notes.update"
                    }
                ]
            },
            {
                "function": "__invoke",
                "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
                "type": "->",
                "args": [
                    {
                        "id": "144648",
                        "_route": "notes.notes.update"
                    }
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                "line": 299,
                "function": "call_user_func",
                "args": [
                    {
                        "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
                    },
                    {
                        "id": "144648",
                        "_route": "notes.notes.update"
                    }
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/base.php",
                "line": 1008,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": [
                    "/apps/notes/notes/144648"
                ]
            },
            {
                "file": "/var/www/nextcloud/index.php",
                "line": 38,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": []
            }
        ],
        "File": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 109,
        "Previous": {
            "Exception": "TypeError",
            "Message": "Argument 3 passed to OCA\\Notes\\Controller\\NotesController::update() must be of the type boolean, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 170",
            "Code": 0,
            "Trace": [
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 170,
                    "function": "update",
                    "class": "OCA\\Notes\\Controller\\NotesController",
                    "type": "->",
                    "args": [
                        "*** sensitive parameters replaced ***"
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 99,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Notes\\Controller\\NotesController"
                        },
                        "update"
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                    "line": 125,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Notes\\Controller\\NotesController"
                        },
                        "update"
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",
                    "line": 47,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::",
                    "args": [
                        "OCA\\Notes\\Controller\\NotesController",
                        "update",
                        {
                            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                        },
                        {
                            "id": "144648",
                            "_route": "notes.notes.update"
                        }
                    ]
                },
                {
                    "function": "__invoke",
                    "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
                    "type": "->",
                    "args": [
                        {
                            "id": "144648",
                            "_route": "notes.notes.update"
                        }
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                    "line": 299,
                    "function": "call_user_func",
                    "args": [
                        {
                            "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
                        },
                        {
                            "id": "144648",
                            "_route": "notes.notes.update"
                        }
                    ]
                },
                {
                    "file": "/var/www/nextcloud/lib/base.php",
                    "line": 1008,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->",
                    "args": [
                        "/apps/notes/notes/144648"
                    ]
                },
                {
                    "file": "/var/www/nextcloud/index.php",
                    "line": 38,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::",
                    "args": []
                }
            ],
            "File": "/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php",
            "Line": 185
        },
        "CustomMessage": "--"
    },
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36",
    "version": "18.0.6.0"
}

@korelstar
Copy link
Member

@HuyNguyenAu No problem, it's fine to update the original post, but a hint would be helpful. I just didn't realized that.

So it looks that the parameter autotitle was not send by the client (your browser). I thought about why this could happen, but I didn't found a solution yet.

Could you please try another browser? Maybe there is something special with that "Brave" browser.

@HuyNguyenAu
Copy link
Author

@korelstar It seems that using Edge(chromium) and Firefox seems to also have the same issue.

@korelstar
Copy link
Member

Hmm, too bad. I can't find any issues in the code which could lead to this problem. Therefore, please try the following two things, since in some setups they can fix strange issues:

  • uninstall the app and re-install it from the appstore
  • restart php-fpm (if you use it) as well as your webserver and then test again

Does this help?

@HuyNguyenAu
Copy link
Author

I can fix it by copying the broken note to a newly created note.

@korelstar
Copy link
Member

Do you mean that the problem happens for a single specific note only?

@korelstar
Copy link
Member

@HuyNguyenAu Please update to the latest release 3.6.0. This should fix your issue.

@HuyNguyenAu
Copy link
Author

@korelstar Thanks. I'll try it out. It happens to many notes.

@HuyNguyenAu
Copy link
Author

HuyNguyenAu commented Jul 1, 2020

@korelstar The new update fixed the issue. Thanks for your help!

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

2 participants