{"action":"opened","issue":{"url":"https://api.github.com/repos/RuudBurger/CouchPotatoServer/issues/4789","labels_url":"https://api.github.com/repos/RuudBurger/CouchPotatoServer/issues/4789/labels{/name}","comments_url":"https://api.github.com/repos/RuudBurger/CouchPotatoServer/issues/4789/comments","events_url":"https://api.github.com/repos/RuudBurger/CouchPotatoServer/issues/4789/events","html_url":"https://github.com/RuudBurger/CouchPotatoServer/issues/4789","id":64506122,"number":4789,"title":"Folder permissions not set, but file permissions are","user":{"login":"Anthirian","id":704388,"avatar_url":"https://avatars.githubusercontent.com/u/704388?v=3","gravatar_id":"","url":"https://api.github.com/users/Anthirian","html_url":"https://github.com/Anthirian","followers_url":"https://api.github.com/users/Anthirian/followers","following_url":"https://api.github.com/users/Anthirian/following{/other_user}","gists_url":"https://api.github.com/users/Anthirian/gists{/gist_id}","starred_url":"https://api.github.com/users/Anthirian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anthirian/subscriptions","organizations_url":"https://api.github.com/users/Anthirian/orgs","repos_url":"https://api.github.com/users/Anthirian/repos","events_url":"https://api.github.com/users/Anthirian/events{/privacy}","received_events_url":"https://api.github.com/users/Anthirian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-26T11:37:33Z","updated_at":"2015-03-26T11:37:33Z","closed_at":null,"body":"I'm having an issue with folder permissions not being set correctly according to my settings (0775 for folders, 0664 for files). This is annoying, since I rely on it for Kodi to be able to delete the files from the NFS shares they're hosted on. Modifying files on NFS shares from within Kodi requires the same group id on the share as the user running Kodi, which is why I run Couchpotato as group \"kodi\" (gid 554, the Administrators group on Windows). Starting Couchpotato this way ensures the group is set correctly for the downloaded files, but somehow the permissions are not. This means the group doesn't have write permissions, which are required if I'm going to delete files later on.\r\n\r\nOutput of `ls -la` in the entire movies folder: \r\n\r\n```\r\n...\r\ndrwxr-xr-x  2 pi kodi  4096 Mar 26 07:39 Hijacking, A (2012)\r\n...\r\n```\r\n\r\nOutput of `ls -la` inside the movie folder: \r\n\r\n```\r\ntotal 10241580\r\ndrwxr-xr-x  2 pi kodi        4096 Mar 26 07:39 .\r\ndrwxrwxr-x 30 pi kodi        4096 Mar 26 07:39 ..\r\n-rw-rw-r--  1 pi kodi 10487126049 Oct 15  2013 a.hijacking.2012.1080p.bluray.dts.x264-publichd.mkv\r\n-rw-rw-r--  1 pi kodi          36 Mar 26 07:39 a.hijacking.2012.1080p.bluray.dts.x264-publichd.nfo\r\n-rw-rw-r--  1 pi kodi       60314 Mar 26 07:39 a.hijacking.2012.1080p.bluray.dts.x264-publichd.nl.srt\r\n-rw-rw-r--  1 pi kodi        1027 Oct 15  2013 a.hijacking.2012.1080p.bluray.dts.x264-publichd.orig.nfo\r\n-rw-rw-r--  1 pi kodi      164828 Mar 26 07:39 folder.jpg\r\n```\r\n\r\nAs you can see the specified file permissions are fine (0664), but the folder permissions are not (0775).\r\n\r\n\r\n### Steps to reproduce:\r\n1. Add (any) available movie to wanted list\r\n2. Wait for it to finish downloading\r\n3. Check download folder and file permissions\r\n\r\n### Information:\r\nMovie(s) I have this with: A Hijacking (2012), Rush (2013), possibly others\r\nQuality of the movie being searched: 720p, 1080p\r\nProviders I use: KAT, Torrentz, Yify, about 25 Newznab indexers\r\nVersion of CouchPotato: git:(RuudBurger:CouchPotatoServer master) abfd9d08 (2015-03-23 15:23:09)\r\nRunning on: Raspberry Pi 2 with Raspbian\r\n\r\n### Logs:\r\nI have enabled debug logging before running the test.\r\n\r\n```\r\n03-26 06:00:40 INFO  [o.core.downloaders.nzbget] Sending \"Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD\" to NZBGet. \r\n03-26 06:00:45 INFO  [o.core.downloaders.nzbget] NZB sent successfully to NZBGet \r\n03-26 06:00:45 INFO  [tato.core.plugins.release] Snatched \"Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD\": A Hijacking (2012) in 1080p \r\n03-26 06:00:45 INFO  [hpotato.core.plugins.base] Opening url: post http://api.trakt.tv/movie/library/290eb393748409b4c7a3a3b6f96c7ee6, data: ['username', 'movies', 'password'] \r\n03-26 06:00:45 INFO  [hpotato.core.plugins.base] Opening url: post http://192.168.0.19:8000/jsonrpc, data: with data \r\n03-26 06:00:45 ERROR  [hpotato.core.plugins.base] Failed opening url in Trakt: http://api.trakt.tv/movie/library/290eb393748409b4c7a3a3b6f96c7ee6 Traceback (most recent call last):\r\nHTTPError: 503 Server Error: Service Unavailable\r\n03-26 06:00:45 ERROR  [.core.notifications.trakt] Failed to call trakt, check your login. \r\n03-26 06:00:46 INFO  [re.notifications.pushover] Pushover notifications sent. \r\n03-26 06:00:48 INFO  [hpotato.core.plugins.base] Opening url: get http://192.168.0.19:8000/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(CouchPotato,Snatched%20%22Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS\r\n.x264-PublicHD%22%3A%20A%20Hijacking%20%282012%29%20in%201080p,'',https%3A//raw.github.com/RuudBurger/CouchPotatoServer/master/couchpotato/static/images/notify.couch.medium.png)), data: [] \r\n03-26 06:00:48 ERROR  [.core.notifications.growl] Failed growl notification. \r\n03-26 07:39:20 INFO  [tato.core.plugins.renamer] Download of Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240).nzb completed! \r\n03-26 07:39:20 INFO  [tato.core.plugins.renamer] Scanning media folder /mnt/storage/downloads/unsorted/movies/Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240)... \r\n03-26 07:39:21 INFO  [tato.core.plugins.scanner] Found 1 movies in the folder /mnt/storage/downloads/unsorted/movies \r\n03-26 07:39:21 INFO  [hpotato.core.plugins.base] Opening url: get https://api.couchpota.to/info/tt2216240/, data: [] \r\n03-26 07:39:21 INFO  [hpotato.core.plugins.base] Opening url: get http://www.omdbapi.com/?type=movie&i=tt2216240, data: [] \r\n03-26 07:39:21 INFO  [hpotato.core.plugins.base] Opening url: get http://api.themoviedb.org/3/movie/tt2216240?api_key=xxx&append_to_response=alternative_titles, data: [] \r\n03-26 07:39:21 INFO  [ie.providers.info.omdbapi] Found: A Hijacking (2012) \r\n03-26 07:39:24 INFO  [ato.core.plugins.subtitle] Found subtitle (nl): [u'/mnt/storage/downloads/unsorted/movies/Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240)/Kapringen.1080p/a.hijacking\r\n.2012.1080p.bluray.dts.x264-publichd.mkv'] \r\n03-26 07:39:24 INFO  [tato.core.plugins.renamer] Moving \"/mnt/storage/downloads/unsorted/movies/Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240)/Kapringen.1080p/a.hijacking.2012.1080p.blur\r\nay.dts.x264-publichd.nfo\" to \"/mnt/storage/downloads/movies/Hijacking, A (2012)/a.hijacking.2012.1080p.bluray.dts.x264-publichd.orig.nfo\" \r\n03-26 07:39:24 INFO  [tato.core.plugins.renamer] Moving \"/mnt/storage/downloads/unsorted/movies/Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240)/Kapringen.1080p/a.hijacking.2012.1080p.blur\r\nay.dts.x264-publichd.mkv\" to \"/mnt/storage/downloads/movies/Hijacking, A (2012)/a.hijacking.2012.1080p.bluray.dts.x264-publichd.mkv\" \r\n03-26 07:39:24 INFO  [tato.core.plugins.renamer] Moving \"/mnt/storage/downloads/unsorted/movies/Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240)/Kapringen.1080p/a.hijacking.2012.1080p.blur\r\nay.dts.x264-publichd.nl.srt\" to \"/mnt/storage/downloads/movies/Hijacking, A (2012)/a.hijacking.2012.1080p.bluray.dts.x264-publichd.nl.srt\" \r\n03-26 07:39:24 INFO  [tato.core.plugins.renamer] Deleting folder: /mnt/storage/downloads/unsorted/movies/Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240) \r\n03-26 07:39:24 ERROR  [hpotato.core.plugins.base] Couldn't remove empty directory /mnt/storage/downloads/unsorted/movies/Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240): Traceback (most\r\nrecent call last):\r\n  File \"/opt/CouchPotato/couchpotato/core/plugins/base.py\", line 179, in deleteEmptyFolder\r\n    os.rmdir(folder)\r\nOSError: [Errno 39] Directory not empty: '/mnt/storage/downloads/unsorted/movies/Kapringen.aka.A.Hijacking.2012.1080p.BluRay.DTS.x264-PublicHD.cp(tt2216240)'\r\n03-26 07:39:24 INFO  [e.providers.metadata.base] Creating XBMC metadata. \r\n03-26 07:39:24 INFO  [hpotato.core.plugins.base] Opening url: get http://api.themoviedb.org/3/movie/tt2216240?api_key=xxx&append_to_response=alternative_titles%2Cimages%2Ccasts, data: [] \r\n03-26 07:39:24 INFO  [ie.providers.info.omdbapi] Found: A Hijacking (2012) \r\n03-26 07:39:24 INFO  [hpotato.core.plugins.base] Opening url: get http://webservice.fanart.tv/v3/movies/tt2216240?api_key=xxx \r\n03-26 07:39:24 INFO  [hpotato.core.plugins.base] Opening url: post http://192.168.0.19:8000/jsonrpc, data: with data \r\n03-26 07:39:27 INFO  [hpotato.core.plugins.base] Opening url: get http://192.168.0.19:8000/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(CouchPotato,Downloaded%20A%20Hijacking%20%281080p%29,'',https%3A//raw.git\r\nhub.com/RuudBurger/CouchPotatoServer/master/couchpotato/static/images/notify.couch.medium.png)), data: [] \r\n03-26 07:39:30 INFO  [hpotato.core.plugins.base] Opening url: post http://192.168.0.19:8000/jsonrpc, data: with data \r\n03-26 07:39:34 INFO  [re.notifications.pushover] Pushover notifications sent. \r\n03-26 07:39:34 INFO  [e.providers.metadata.base] Creating WindowsMediaCenter metadata. \r\n03-26 07:39:34 INFO  [ie.providers.info.omdbapi] Found: A Hijacking (2012) \r\n03-26 07:39:34 INFO  [hpotato.core.plugins.base] Opening url: get https://image.tmdb.org/t/p/original/dH6802d6C3YXdafA91qMxudZV24.jpg, data: [] \r\n03-26 07:39:36 ERROR  [.core.notifications.growl] Failed growl notification. \r\n03-26 07:39:37 INFO  [tato.core.plugins.scanner] Found 1 movies in the folder /mnt/storage/downloads/movies/Hijacking, A (2012) \r\n```"}}