"Share failed" when generating Download link

seahub

#1

When generating a “Share Link” from seafile client “cloud file browser” I get a warning: “Share failed”.

When generating a Share link from seahub, I cannot even load the page.
Debug console: “SyntaxError: JSON.parse: unexpected character at line 3 column 1 of the JSON data”

I could trace that error back to main.js (155:10961):
... prepareCollectionFetchErrorMsg:function(e,t,i){ var n;return t.responseText?401==t.status? n=gettext("Permission error"): 403==t.status? (n=gettext("Permission error"),location.href=app.config.loginUrl+"?next="+encodeURIComponent(location.pathname+location.hash)) :n=this.HTMLescape(JSON.parse(t.responseText).error_msg) :n=gettext("Please check the network."),n } ...
which is called here (173:24680):
... showContent: function(){ // need to insert the following line, otherwise error: "_this not defined" var _this = this; this.initPage(),this.folders.fetch({ cache:!1,reset:!0,error:function(e,t,i){_this.$loadingTip.hide(); var r=_this.$(".error"),s=n.prepareCollectionFetchErrorMsg(e,t,i);r.html(s).show()}})}

I already have the required column permission varchar(50) in share_fileshare:

seahub_db=# \d share_fileshare Table "public.share_fileshare" Column | Type | Collation | Nullable | Default -------------+--------------------------+-----------+----------+--------------------------------------------- id | integer | | not null | nextval('share_fileshare_id_seq'::regclass) username | character varying(255) | | not null | repo_id | character varying(36) | | not null | path | text | | not null | token | character varying(100) | | not null | ctime | timestamp with time zone | | not null | view_cnt | integer | | not null | s_type | character varying(2) | | not null | password | character varying(128) | | | expire_date | timestamp with time zone | | | permission | character varying(50) | | not null | 'view_download'::character varying Indexes: "share_fileshare_pkey" PRIMARY KEY, btree (id) "share_fileshare_token_key" UNIQUE CONSTRAINT, btree (token) "share_fileshare_repo_id" btree (repo_id) "share_fileshare_repo_id_like" btree (repo_id varchar_pattern_ops) "share_fileshare_s_type" btree (s_type) "share_fileshare_s_type_like" btree (s_type varchar_pattern_ops) "share_fileshare_token_like" btree (token varchar_pattern_ops) "share_fileshare_username" btree (username) "share_fileshare_username_like" btree (username varchar_pattern_ops) Referenced by: TABLE "share_orgfileshare" CONSTRAINT "share_orgfileshare_file_share_id_fkey" FOREIGN KEY (file_share_id) REFERENCES share_fileshare(id) DEFERRABLE INITIALLY DEFERRED

Please look into this!!