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

repair corrupted share entries #29024

Closed
3 tasks
butonic opened this issue Sep 15, 2017 · 3 comments
Closed
3 tasks

repair corrupted share entries #29024

butonic opened this issue Sep 15, 2017 · 3 comments

Comments

@butonic
Copy link
Member

butonic commented Sep 15, 2017

Found on my instance that has been upgraded from oc 4.5 IIRC:

{"reqId":"ARlhCnrBywxjGYDzp5eV","level":3,"time":"2017-09-15T14:50:18+00:00","remoteAddr":"77.20.64.21","user":"foo","app":"PHP","method":"GET","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json&path=%2FSomething%2F&reshares=true","message":"Symfony\\Component\\Routing\\Exception\\InvalidParameterException: Parameter \"token\" for route \"files_sharing.sharecontroller.showShare\" must match \"[^\/]++\" (\"\" given) to generate a corresponding URL. at \/var\/www\/owncloud\/owncloud-10.0.1\/lib\/composer\/symfony\/routing\/Generator\/UrlGenerator.php#163"}

as it turns out I have corrupt share entries, aka links without a token:

SELECT * FROM oc_share WHERE share_type=3 AND token IS NULL;
+----+------------+------------+-----------+--------+-----------+-------------+-------------+-------------+---------------------------+-------------+------------+----------+------------+-------+-----------+---------------+------------+
| id | share_type | share_with | uid_owner | parent | item_type | item_source | item_target | file_source | file_target               | permissions | stime      | accepted | expiration | token | mail_send | uid_initiator | share_name |
+----+------------+------------+-----------+--------+-----------+-------------+-------------+-------------+---------------------------+-------------+------------+----------+------------+-------+-----------+---------------+------------+
|  1 |          3 | NULL       | foo       |   NULL | folder    | 30775       | /30775      |       30775 | /Something                |          17 | 1349950488 |        0 | NULL       | NULL  |         0 | foo           | NULL       |
|  2 |          3 | NULL       | foo       |   NULL | folder    | 30774       | /30774      |       30774 | /Something Else           |          17 | 1349950488 |        0 | NULL       | NULL  |         0 | foo           | NULL       |
+----+------------+------------+-----------+--------+-----------+-------------+-------------+-------------+---------------------------+-------------+------------+----------+------------+-------+-----------+---------------+------------+
2 rows in set (0.00 sec)

This causes my 'shared with others' page to be empty, no error in the web ui.

  • add repair step that does DELETE FROM oc_share WHERE share_type=3 AND token IS NULL;
  • expose exception to API call, don't swallow that exception, bad for your karma.
  • add a report to the admin section with the last n errors? would require parsing the logfile ... sucks ... store log in db? new log provider? hmmm
@PVince81
Copy link
Contributor

We already have repair steps for broken/invalid shares. We should extend that one to also cover missing tokens.

@IljaN IljaN assigned IljaN and unassigned IljaN Oct 10, 2017
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

@PVince81
Copy link
Contributor

still valid, I hope we'll find time some day to do this...

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

6 participants