[13:25:55] Hello everyone. I recently installed MW1.39 and everything is working smoothly but when I'm trying to upload image I'm getting the following error. Could not open lock file for "mwstore://local-backend/local-public/d/d7/Example.png". Make sure your upload directory is configured correctly and your web server has permission to write to that [13:25:56] directory. [13:26:29] In localsettings I have [13:26:30] $wgEnableUploads = true; [13:26:30] $wgUploadDirectory = "{$IP}/images"; [13:28:43] Can someone please help what is wrong? why I'm not able to upload images? [13:28:51] The images folder has 755 permission. [13:32:07] What about the owner/group? [13:35:34] Hello sir Reedy sorry I didn't get what you mean by owner/group can you please elaborate a bit. [13:37:31] I gues what he's getting at is does the user running the web server have permission to write in that directory? "755" doesn't really tell us anything because we don't know what user/group that directory has or what user is running the web server [13:38:24] I have the site in IP Address/var/www/html/ I tried to upload the file in the image folder directly and when I'm opening it as Ip address/var/www/html/images/Example.png but if I'm opening the same file as Ip address/images/Example.png I can see the image. [13:39:22] The group permission for folder image is Read and Write. [13:39:44] Sorry Read and Execute [13:39:55] and Owner has Read, Write and Execute [13:40:10] Public has Read and Execute. [13:40:50] Right, but is the owner of the folder the same user that's running the web server? [13:43:30] I'm not sure about it but I assume yes because there is only one user on the server. [13:46:03] On many Linux distributions at least there's usually a separate user for web servers, either by default or created automatically when the server is installed [13:46:33] I think on Debian and derivatives it's called www-data [13:47:05] But that's really something you need to find out on your system [13:48:00] My site is on Ubuntu so is there a way I can check the owner? [13:51:52] Well, ls -l will show you the owner and group of the file. Not sure what the best way to find out the user running the web server is though. I'd assume it's www-data on Ubuntu as well if it's installed through the official package manager [13:53:52] You should probably make sure you read https://www.mediawiki.org/wiki/Manual:Security#File_permissions before touching anything though [13:55:37] Thank you for sharing the details. I will look at them and try to find an answer and then get back with more details. Also, after getting the user for the /image folder what settings I need to change on MW? [13:56:30] Doesn't seem like there's anything to change in MW config. You just need to figure out the filesystem permissions so they allow the web server to write in the images folder [13:56:48] Ok thank you [13:56:57] Guest255: best way to check the user running the webserver and to discard permission issues, is to set permissions to the images directory recursively to 777 (but only for directories!). For example with this command: find /path/to/images -type d -exec chmod 777 {} \; [13:57:19] then upload a file and if it succeeds, you can see the owner of the newly created file [13:57:39] Ohh ok let me try that. Thank you :) [13:57:57] thenm adjust permissions and owner accordingly [13:59:17] Ahh it was uploaded successfully. [14:02:54] The owner is www-data [14:03:12] Same for the group [14:05:47] you can set the owner recursively, and run the command again to set folder permissions to 755: find /path/to/images -type d -exec chmod 755 {} \; [14:08:39] Sure. The owner and group for the images folder is root so I need to change it to www-data right? [14:19:19] yes [18:15:36] anyone here use Discord on occasion? I think I've found a bug in how Discord tries to generate link previews for MediaWiki sites, but would like to confirm the source of the problem... [18:16:03] when I post a link such as https://bg3.wiki/wiki/King's_Knife to Discord, I see two GET requests on my web server from Discordbot: once for that URL, and once for: https://bg3.wiki/w/api.php?action=query&prop=extracts&exintro=&explaintext=&format=json&titles=King%2527s_Knife [18:16:28] if you look closely at that long api.php URL, you'll notice that the URL encoding is messed up, it should be %27 not %2527 [18:17:01] now the question is: does MediaWiki in some way tell Discord to look up that URL, or does Discord decide to stitch together that URL on its own volition, based on the fact that it detects the website to be MediaWiki-based? [18:18:07] when I search the HTML of https://bg3.wiki/wiki/King's_Knife via view-source: in my browser, I can't see any reference to api.php other than https://bg3.wiki/w/api.php?action=rsd, which leads me to believe that it's Discord's fault [18:23:26] I came to the same conclusion [18:24:17] even with proper encoding, I think only Wikimedia sites have prop=extracts available [18:39:42] yeah mine doesn't produce text extracts anyway so Discord is fetching that URL for nothing... also noting that in my bug report. I've tried the TextExtracts extension but it spits out wikitext :\ [18:39:44] It probably asks that to create the embed text [18:39:54] https://www.mediawiki.org/wiki/Extension:TextExtracts adds prop=extracts [18:40:15] bd808: do you happen to know how to make it *not* spit out wikitext? [18:41:39] It should spit out plain text, but it might take some tweaking depending on what paragraph 0 looks like for your pages. `$wgExtractsRemoveClasses` can be adjusted to strip out more HTML [18:42:36] It's all kind of a hack and a hack that is basically optimized for how Wikipedia articles are designed. [18:43:31] exsectionformat={plain,wiki,raw} is how you change what is returned. Apparently "wiki" is the default per the extension doc page. [18:44:30] oh ok [18:45:44] maybe that was also a problem with Discord then, because they send explaintext= (with an empty value) but not any exsectionformat= [18:46:27] oh wait, that's also a valid parameter as per the docs, but should contain a boolean... one way or another I think it's Discord's fault :D let's hope they process my bug report soon.