After update to V6.03 admin can't see deletes libraries

after update to V6.03:
admin goes to libraries - trash. here i can see only “hourglass”

seahub.django.request.log:
2016-09-15 16:43:16,663 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /api/v2.1/admin/trash-libraries/ Traceback (most recent call last): File "/seafile/seafile-server-latest/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/seafile/seafile-server-latest/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/views/decorators/csrf.py", line 58, in wrapped_view return view_func(*args, **kwargs) File "/seafile/seafile-server-latest/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, **kwargs) File "/seafile/seafile-server-latest/seahub/thirdpart/djangorestframework-3.3.2-py2.7.egg/rest_framework/views.py", line 466, in dispatch response = self.handle_exception(exc) File "/seafile/seafile-server-latest/seahub/thirdpart/djangorestframework-3.3.2-py2.7.egg/rest_framework/views.py", line 463, in dispatch response = handler(request, *args, **kwargs) File "/seafile/seafile-server-6.0.3/seahub/seahub/api2/endpoints/admin/trash_libraries.py", line 83, in get repo_info = get_trash_repo_info(repo) File "/seafile/seafile-server-6.0.3/seahub/seahub/api2/endpoints/admin/trash_libraries.py", line 28, in get_trash_repo_info result['delete_time'] = timestamp_to_isoformat_timestr(repo.del_time) File "/seafile/seafile-server-6.0.3/seahub/seahub/utils/timeutils.py", line 42, in timestamp_to_isoformat_timestr dt_obj = datetime.datetime.fromtimestamp(timestamp/1000000) ValueError: timestamp out of range for platform time_t

We will look into the issue.

hi, which database do u use ? sqlite or mysql ?

can u paste some data in your RepoTrash table ? If u are using mysql, it should be something like this:

mysql> select del_time from RepoTrash;
+------------+
| del_time   |
+------------+
| 1472287279 |
| 1472284988 |
| 1473154000 |
| 1472525083 |
| 1472787685 |
| 1472525076 |
| 1472025011 |
| 1472014869 |
+------------+
8 rows in set (0.00 sec)

we use sqlite.
can you give me a hint for that too?

that’s the result:

+---------+ | del_time▕ +---------+-----------+ | 5516662472713433639 | | 5059501820105207958 | | 4702602634947111901 | +---------------------+

I tested with sqlite, but don’t have your issue. Could you post the table schema of RepoTrash table? In sqlite you can get it by .schema command. And what OS are you using? Do these delete libraries already exist before upgrade to 6.0.3?

Hi,
I’m having exact same issue and I’m using mysql on Ubuntu 16.04. Here are my results:

mysql> select del_time from RepoTrash;
±--------------------+
| del_time |
±--------------------+
| 5598925025011376403 |
| 5046555401401319198 |
| 5340743339574553496 |
| 5051207392148481344 |
| 5527026220209793951 |
±--------------------+
5 rows in set (0,00 sec)

mysql> describe RepoTrash;
±----------±-------------±-----±----±--------±------+
| Field | Type | Null | Key | Default | Extra |
±----------±-------------±-----±----±--------±------+
| repo_id | char(36) | NO | PRI | NULL | |
| repo_name | varchar(255) | YES | | NULL | |
| head_id | char(40) | YES | | NULL | |
| owner_id | varchar(255) | YES | MUL | NULL | |
| size | bigint(20) | YES | | NULL | |
| org_id | int(11) | YES | MUL | NULL | |
| del_time | bigint(20) | YES | | NULL | |
±----------±-------------±-----±----±--------±------+
7 rows in set (0,00 sec)

These libraries didn’t exist before the update to 6.0.3 because they are all libraries with names like eg. ‘MSI2a533.tmp’ and most likey created by SeaDrive.

I am running seafile under debian 7

.schema RepoTrash:
CREATE TABLE RepoTrash (repo_id CHAR(36) PRIMARY KEY,repo_name VARCHAR(255), head_id CHAR(40), owner_id VARCHAR(255), size BIGINT UNSIGNED,org_id INTEGER, del_time BIGINT); CREATE INDEX repotrash_owner_id_idx ON RepoTrash(owner_id); CREATE INDEX repotrash_org_id_idx ON RepoTrash(org_id);

i am not shure, but i think that some libraries exist before update and at least 1 was deleted afterwards.

I’m having the same problem with 6.0.3 on Ubuntu 14.04 with MySQL:

mysql> select repo_id, size, org_id, del_time from RepoTrash;
+--------------------------------------+--------------+--------+---------------------+
| repo_id                              | size         | org_id | del_time            |
+--------------------------------------+--------------+--------+---------------------+
| 0991b7f7-fcaa-42eb-8375-381c7cafd090 | 253843604741 |     -1 | 4822225634579371606 |
| 2d625aaf-ba08-47cd-a7e2-9f3d7c6a5f21 |            0 |     -1 | 5173996091886320805 |
| 7e4a9f46-f21f-4724-ba19-fd553e6461cf |            0 |     -1 | 5126488492258176734 |
| 7ebdec20-bb13-4640-bc58-e1b977954de3 |   2293703532 |     -1 | 5062251672917694055 |
| 88a92069-e6eb-4b18-98a2-26220e73bbd4 |       300544 |     -1 | 5411328850751838506 |
| 8fec8a74-fe43-4799-96a1-d9d5f9df7254 |      9622902 |     -1 | 5159434413290054321 |
| 99f8b75f-8c0b-4579-851b-e7384db2cf56 |          143 |     -1 | 5006186441146029676 |
| a860928d-4bb9-4db2-b020-1fb14b5ce7e8 |       300544 |     -1 | 5598620546160192196 |
| aa052480-e309-4e21-bbb5-b884415e8745 | 166797804332 |     -1 | 5630030638458525274 |
| aa0cd9ab-f93e-447e-9b4e-52c35f83347a |            0 |     -1 | 4935656287773179052 |
| abb182b5-a0c8-4660-9395-e23cc3e7f4c5 |            0 |     -1 | 5071229962718329147 |
| aea47d4e-3926-4654-9389-d81ca3505843 |    346478266 |     -1 | 5067738317514367662 |
| b1beb5ac-d561-4886-8381-27734658e051 |    615885105 |     -1 | 5226099031653524250 |
| cdf37ed4-985d-4327-b07d-1c3d71d7ce5a |            0 |     -1 | 4839003851278069473 |
| cf793f21-9f7a-4b38-8bf5-626c5c768ebc |            0 |     -1 | 5420257499320466600 |
| eec2327d-28c8-4fa2-855a-c263f5a2ad3b |    187664087 |     -1 | 5738193716156487263 |
+--------------------------------------+--------------+--------+---------------------+

This workaround helped for urgently removing libraries (I needed the space):

mysql> update RepoTrash set del_time = 1;
Query OK, 16 rows affected (0.01 sec)
Rows matched: 16  Changed: 16  Warnings: 0

The web interface then showed me that the libraries were put to trash 47 years ago and I could delete them. :slight_smile:

We cannot reproduce the problem unfortunately. In some OS the value of del_time is just wrong for some reasons. But we’ve fixed a potential cause of the problem in 6.0.4. You can try it. But you still need to manually set the del_time in database before you can load the library trash page.

congratulations!
after update to 6.0.4 it works :wink:

@Matthias_Schneider and @Waschmittel
if it works at your site too - we can set it to solved

updated to 6.0.4 and now I can see deleted libraries. Thanks and keep up the good work!

I have a similar problem on the “Seafile Server 6.0.3 for Raspberry Pi” version (mysql). I can delete libraries, but can’t see the deleted ones in the admin area.

As a temporary solution I deleted the hole library (seafile/seafile-data/storage/blocks/)…- but this is like killing a mosquito with a gun oO

Will there be a fix too? How can I manually fix this issue? Cheers

Works again for me with 6.0.4, too! Thanks a lot!

I think you had to wait for the next Raspberry Pi Version. Alternatively follow this suggestion:

This workaround helped for urgently removing libraries (I needed the space):

mysql> update RepoTrash set del_time = 1;
Query OK, 16 rows affected (0.01 sec)
Rows matched: 16 Changed: 16 Warnings: 0

The web interface then showed me that the libraries were put to trash 47 years ago and I could delete them. :slight_smile:

1 Like

Hey thx for your answer the prob is i am not very well into mysql, if i type in the following iam getting errors:

mysql> select seafile
-> update RepoTrash set del_time = 1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘update RepoTrash set del_time = 1’ at line 2
mysql>
May you tell me what i am actually doing wrong?

Cheers

Hi Charly,

after logging on to mysql use following commands:

mysql> use seafile-db;
Database changed
mysql> update RepoTrash set del_time = 1;

Matt

1 Like