Can't create download link

Hi Everybody

Since a short while I can’t create download links anymore.
The error message is “Share failed” when trying to create a link in the seafilebrowser.

When trying to create a link in the web interface, I just get a constantly turning “wheel”.

Seafile.log and Seahub.log do not show any error messages.

What could I do to fix this or to start with: what could I do to nail down the issue (log)?

Thanks for any help in advance,

Chris

Hi GITchristoph,

here are some ideas from my side:

  1. disk space available?
  2. restart seafile and seahub - any error messages?
  3. please provide more information: system (win/linux), version etc.

Best regards
Christoph

Hi Christoph

  1. DIsk space is available, but I want to mention that computer ran into a disk space issue about a week ago, which I had to fix with a Garbage Collection run. This is fixed now, hope it does not have any impact on the server?
    I can’t find a log that shows me issues.
  2. As I mentioned, there are no error messages in Seafile.log or Seahub.log.
    There is an error message in the ccnet.log. Not sure if this is relevant (see below).
    Seafile log:

[01/18/18 09:30:50] http-server.c(161): fileserver: worker_threads = 10
[01/18/18 09:30:50] http-server.c(176): fileserver: fixed_block_size = 8388608
[01/18/18 09:30:50] http-server.c(191): fileserver: web_token_expire_time = 3600
[01/18/18 09:30:50] http-server.c(206): fileserver: max_indexing_threads = 1
[01/18/2018 09:30:50 AM] …/common/mq-mgr.c(54): [mq client] mq cilent is started
[01/18/2018 09:30:50 AM] listen-mgr.c(120): listen on port 12001 for block tranfer
[01/18/2018 09:30:51 AM] size-sched.c(96): Repo size compute queue size is 0
[01/18/2018 10:08:03 AM] size-sched.c(96): Repo size compute queue size is 24
[01/18/2018 10:34:28 AM] size-sched.c(96): Repo size compute queue size is 44
[01/18/2018 10:58:40 AM] size-sched.c(96): Repo size compute queue size is 54
[01/18/2018 11:18:33 AM] size-sched.c(96): Repo size compute queue size is 106
[01/18/2018 11:36:51 AM] size-sched.c(96): Repo size compute queue size is 162

Seahub.log
no entries in the log since November 2017

ccnet.log

[01/18/18 09:30:49] …/common/session.c(132): using config file /home/ck/seafile/conf/ccnet.conf
[01/18/18 09:30:49] …/common/session.c(455): socket file exists, delete it anyway
[01/18/18 09:30:49] …/common/session.c(484): Listen on /home/ck/seafile/ccnet/ccnet.sock for local clients
[01/18/18 09:30:49] …/common/session.c(290): Update pubinfo file
[01/18/18 09:30:49] …/common/connect-mgr.c(515): Opened port 10001 to listen for incoming peer connections
[01/18/18 09:30:50] …/common/session.c(398): Accepted a local client
[01/18/18 09:30:50] …/common/session.c(398): Accepted a local client
[01/18/18 09:30:50] …/common/session.c(398): Accepted a local client
[01/18/18 09:30:50] …/common/session.c(398): Accepted a local client
[01/18/18 09:30:55] …/common/session.c(398): Accepted a local client
[01/18/18 09:31:01] …/common/session.c(398): Accepted a local client
[01/18/18 09:31:01] …/common/peer.c(943): Local peer down
[01/18/18 09:31:15] …/common/session.c(398): Accepted a local client
[01/18/18 09:31:21] …/common/session.c(398): Accepted a local client
[01/18/18 09:31:27] …/common/session.c(398): Accepted a local client
[01/18/18 09:31:46] …/common/session.c(398): Accepted a local client
[01/18/18 09:35:07] …/common/session.c(398): Accepted a local client
[01/18/18 10:09:58] …/common/session.c(398): Accepted a local client
[01/18/18 10:09:58] …/common/session.c(398): Accepted a local client

  1. Server runs on Ubuntu 14.04, Seafile server version is 6.2.3

This is all I get when trying to share a file in my webbrowser. The “wheel” turns forever.

Open browser developer panel and go to console, then try to create download link. Error should be presented there, post it here please.

1 Like

Thanks for that tip!
There was an error message.
500 (INTERNAL SERVER ERROR)

This is the output in google Chrome:

GET https://cloud.example.com/api/v2.1/share-links/?repo_id=8exxx7-3b5a-4f6f-xxx-748xxxx0bxxx&path=%2FCamera+Uploads%2FIMG_0650.JPG&_=1516278935042 500 (INTERNAL SERVER ERROR)
send @ main.68c570aae3d0.js:212
ajax @ main.68c570aae3d0.js:212
downloadLinkPanelInit @ main.68c570aae3d0.js:212
initialize @ main.68c570aae3d0.js:212
t.View @ main.68c570aae3d0.js:212
i @ main.68c570aae3d0.js:212
share @ main.68c570aae3d0.js:212
dispatch @ main.68c570aae3d0.js:212
g.handle @ main.68c570aae3d0.js:212

main.68c570aae3d0.js:212 Uncaught TypeError: Cannot read property ‘error_msg’ of undefined
at Object.error (main.68c570aae3d0.js:212)
at f (main.68c570aae3d0.js:212)
at Object.fireWith [as rejectWith] (main.68c570aae3d0.js:212)
at x (main.68c570aae3d0.js:212)
at XMLHttpRequest.t (main.68c570aae3d0.js:212)
error @ main.68c570aae3d0.js:212
f @ main.68c570aae3d0.js:212
fireWith @ main.68c570aae3d0.js:212
x @ main.68c570aae3d0.js:212
t @ main.68c570aae3d0.js:212
XMLHttpRequest.send (async)
send @ main.68c570aae3d0.js:212
ajax @ main.68c570aae3d0.js:212
downloadLinkPanelInit @ main.68c570aae3d0.js:212
initialize @ main.68c570aae3d0.js:212
t.View @ main.68c570aae3d0.js:212
i @ main.68c570aae3d0.js:212
share @ main.68c570aae3d0.js:212
dispatch @ main.68c570aae3d0.js:212
g.handle @ main.68c570aae3d0.js:212

I just looked at the seahub_django_request.log

This should be helpful!

Can someone help me debugging this?
That would be so much appreciated.

OperationalError: (1054, “Unknown column ‘share_fileshare.permission’ in ‘field list’”)
2018-01-18 13:37:24,664 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /api/v2.1/share-links/
Tracebaxyz (most recent call last):
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/handlers/base.py”, line 132, in get_response
response = wrapped_callbaxyz(request, *callbaxyz_args, **callbaxyz_kwargs)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/views/decorators/csrf.py”, line 58, in wrapped_view
return view_func(*args, **kwargs)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/views/generic/base.py”, line 71, in view
return self.dispatch(request, *args, **kwargs)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/djangorestframework-3.3.2-py2.7.egg/rest_framework/views.py”, line 466, in dispatch
response = self.handle_exception(exc)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/djangorestframework-3.3.2-py2.7.egg/rest_framework/views.py”, line 463, in dispatch
response = handler(request, *args, **kwargs)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/seahub/api2/endpoints/share_links.py”, line 143, in get
fileshares = filter(lambda fs: fs.repo_id == repo_id, fileshares)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py”, line 162, in iter
self._fetch_all()
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py”, line 965, in _fetch_all
self._result_cache = list(self.iterator())
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/query.py”, line 238, in iterator
results = compiler.execute_sql()
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/sql/compiler.py”, line 840, in execute_sql
cursor.execute(sql, params)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/baxyzends/utils.py”, line 64, in execute
return self.cursor.execute(sql, params)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py”, line 98, in exit
six.reraise(dj_exc_type, dj_exc_value, tracebaxyz)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/baxyzends/utils.py”, line 64, in execute
return self.cursor.execute(sql, params)
File “/home/xyz/seafile/seafile-server-6.2.3/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/baxyzends/mysql/base.py”, line 124, in execute
return self.cursor.execute(query, args)
File “/usr/lib/python2.7/dist-paxyzages/MySQLdb/cursors.py”, line 174, in execute
self.errorhandler(self, exc, value)
File “/usr/lib/python2.7/dist-paxyzages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1054, “Unknown column ‘share_fileshare.permission’ in ‘field list’”)

Has anything changed recently with the installation. Maybe an in-place upgrade?

If you did an in-place upgrade, did you remember to run the mysql upgrade scripts?

1 Like

Hi

I did an upgrade from 6.1.2 to 6.2.3 because the links stopped working.

I will have to check the MySQL update. I have never done a MySQL update before.

I will check once i am in thw Office.

No need to run mysql upgrade script. It’s included in minor-upgrade.sh script or version upgrade script.

You have missiong column in database, so I guess you forgot run minor_upgrade.sh or uprage_*.*_*.*.sh script or some failed and you didn’t notice it.

Run this command in mysql database. It’s should fix your problem if there’s no more some missiong tables or columns.

ALTER TABLE `share_fileshare` ADD `permission` varchar(50) COLLATE 'utf8_general_ci' NOT NULL;
1 Like

Hi holantomas

Thanks a lot for your help.

I am pretty sure that I did not have any error messages before.
But anyways, could this maybe also come from the issue that I had that the Harddrive was full?

I am not so good with MYSQL. When I paste the line you gave me above (thanks again :wink: ) then I get an error message:

ERROR 1046 (3D000): No database selected

Which database do I need to select?
If you could let me know how I can select a database, that would be nice, but I can also google that then :wink:

if you using command line for database you have to first run use <database-name>; I think by default is seahub database named seahub-db so use seahub-db; and then query which I provide above :wink:

don’t forget for semicolon on the end every commands

EDIT: Be carefull about google. If you don’t know what you doing don’t do it, better is ask here if you can run it, because you can damage your seafile installation.

1 Like

Thanks a lot!

… and hmmmm :wink:

mysql> seahub-db;
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 ‘seahub-db’ at line 1
mysql>

Let me first understand how MYSQL works. Not sure what to do :wink:

You have to do: use seahub-db;

As @holantomas wrote.

1 Like

You forgot use before. For sure again.

use seahub-db;

and then

ALTER TABLE `share_fileshare` ADD `permission` varchar(50) COLLATE 'utf8_general_ci' NOT NULL;

Database work for store app data. You can imagine Database (seahub-db) like MS Excel file. In there are named tables (this can be sheets in Excel). Every table have defined columns and data are rows.
MySQL is just version of database service build on SQL like standards same as MSSQL, OracleDB or Firebird.
SQL is standard how to resolve users queries for data.

We can use for example what we are trying to do.
use seafile-db; we can translate as “Open file seafile-db”

ALTER TABLE `share_fileshare` ADD `permission` varchar(50) COLLATE 'utf8_general_ci' NOT NULL;

Can be translated as “Add column permission typed string with 50 characters and charset UTF-8 which cannot be NULL in sheet/table share_fileshare

More you can read in google, there are tons of queries for selecting, filtering, editing or updating data in tables.

1 Like

Done!
(did not see the “use”. See below for output with correct commands).

And this fixed it, so many many thanks for this input.

→ Can create links works (YEAH !)
→ Direct download links work again (YEAH !)
→ Download links work again (YEAH !)

mysql> use seahub-db
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> ALTER TABLE share_fileshare ADD permission varchar(50) COLLATE ‘utf8_general_ci’ NOT NULL;
Query OK, 14 rows affected (0.05 sec)
Records: 14 Duplicates: 0 Warnings: 0

???

That’s what I meant by running the MySQL upgrade script. Upgrading from 6.1 to 6.2 is going to require running the version upgrade script for the database.

Hi arjones

I did run that script. (6.1 to 6.2 script), when the links stopped working.
It did not solve the issue though.

I am not sure why.

You said “did you remember to run the mysql upgrade scripts?”

But mysql update scripts is automatically called by classic seafile upgrade script. As you can see answer to you response. They think that they have to run some other scripts. But you have to run only upgrade_*.sh.

So I said you don’t have to run “mysql update script”, you have to run only standard seafile upgrade script which call mysql update script automatically. I know what you mean and don’t blame you, just correction cause don’t want to confuse people :slight_smile: