Data folders create problem when installing repos from Github #2424

Closed
opened 2019-02-06 17:13:14 +01:00 by NeuroAssassin · 1 comment
NeuroAssassin commented 2019-02-06 17:13:14 +01:00 (Migrated from github.com)

If you have a repo that you are installing from Github that does have a data folder (but does not have anything in it), it does not copy that data folder when running [p]repo add, which causes errors later when using the cog (no directory named 'data'). If you do include a file in the data folder, it copies the data folder to your desktop locally with [p]repo add, but when you try doing [p]cog install, it fails to copy any of the files to CogManager/cogs (error below), but still tells downloader that it has been installed, thus when trying to do [p]load, it says: The package <cog_name> was not found in any cog path, causing a huge annoying thing. If you then try to delete from downloader's settings that it had been installed, then you can run [p]cog install all you want, but it won't install it and downloader won't mark it down as installed, making nothing happen. One way to get past this is to copy the repo to your desktop with [p]repo add, remove the data folder (if there is one), unload downloader, shutdown your bot, turn it back on, load downloader, run [p]cog install, put in the data folder manually, then run [p]load, however this is not recommended because you're playing around with this manually, and if you do something run, you can mess things up badly. (I just tried that method straight up, nothing else. Confirmed works with my bot. I tested this a total of 3 times).
Error:

[06/02/2019 10:57] ERROR installable copy_to 120: Error occurred when copying path: C:\Users\tmsb7\AppData\Local\Red-DiscordBot\MODOK\cogs\RepoManager\repos\dev\sql
Traceback (most recent call last):
File "c:\users\tmsb7\appdata\local\programs\python\python36-32\Lib\distutils\dir_util.py", line 70, in mkpath
os.mkdir(head, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\tmsb7\AppData\Local\Red-DiscordBot\MODOK\cogs\CogManager\cogs\sql\data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\tmsb7\envs\rewrite\lib\site-packages\redbot\cogs\downloader\installable.py", line 118, in copy_to
copy_func(src=str(self._location), dst=str(target_dir / self._location.stem))
File "c:\users\tmsb7\appdata\local\programs\python\python36-32\Lib\distutils\dir_util.py", line 159, in copy_tree
verbose=verbose, dry_run=dry_run))
File "c:\users\tmsb7\appdata\local\programs\python\python36-32\Lib\distutils\dir_util.py", line 135, in copy_tree
mkpath(dst, verbose=verbose)
File "c:\users\tmsb7\appdata\local\programs\python\python36-32\Lib\distutils\dir_util.py", line 74, in mkpath
"could not create '%s': %s" % (head, exc.args[-1]))
distutils.errors.DistutilsFileError: could not create 'C:\Users\tmsb7\AppData\Local\Red-DiscordBot\MODOK\cogs\CogManager\cogs\sql\data': The system cannot find the path specified

Downloader shows the cog as installed:
image

However, it is not installed and is not in CogManager/cogs:
image

If you have a repo that you are installing from Github that does have a data folder (but does not have anything in it), it does not copy that data folder when running `[p]repo add`, which causes errors later when using the cog (no directory named 'data'). If you do include a file in the data folder, it copies the data folder to your desktop locally with `[p]repo add`, but when you try doing `[p]cog install`, it fails to copy any of the files to CogManager/cogs (error below), but still tells downloader that it has been installed, thus when trying to do `[p]load`, it says: `The package <cog_name> was not found in any cog path,` causing a huge annoying thing. If you then try to delete from downloader's settings that it had been installed, then you can run `[p]cog install` all you want, but it won't install it and downloader won't mark it down as installed, making nothing happen. One way to get past this is to copy the repo to your desktop with `[p]repo add`, remove the data folder (if there is one), unload downloader, shutdown your bot, turn it back on, load downloader, run `[p]cog install`, put in the data folder manually, then run `[p]load`, however this is not recommended because you're playing around with this manually, and if you do something run, you can mess things up badly. (I just tried that method straight up, nothing else. Confirmed works with my bot. I tested this a total of 3 times). Error: [06/02/2019 10:57] ERROR installable copy_to 120: Error occurred when copying path: C:\Users\tmsb7\AppData\Local\Red-DiscordBot\MODOK\cogs\RepoManager\repos\dev\sql Traceback (most recent call last): File "c:\users\tmsb7\appdata\local\programs\python\python36-32\Lib\distutils\dir_util.py", line 70, in mkpath os.mkdir(head, mode) FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\tmsb7\\AppData\\Local\\Red-DiscordBot\\MODOK\\cogs\\CogManager\\cogs\\sql\\data' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\users\tmsb7\envs\rewrite\lib\site-packages\redbot\cogs\downloader\installable.py", line 118, in copy_to copy_func(src=str(self._location), dst=str(target_dir / self._location.stem)) File "c:\users\tmsb7\appdata\local\programs\python\python36-32\Lib\distutils\dir_util.py", line 159, in copy_tree verbose=verbose, dry_run=dry_run)) File "c:\users\tmsb7\appdata\local\programs\python\python36-32\Lib\distutils\dir_util.py", line 135, in copy_tree mkpath(dst, verbose=verbose) File "c:\users\tmsb7\appdata\local\programs\python\python36-32\Lib\distutils\dir_util.py", line 74, in mkpath "could not create '%s': %s" % (head, exc.args[-1])) distutils.errors.DistutilsFileError: could not create 'C:\Users\tmsb7\AppData\Local\Red-DiscordBot\MODOK\cogs\CogManager\cogs\sql\data': The system cannot find the path specified Downloader shows the cog as installed: ![image](https://user-images.githubusercontent.com/42872277/52355316-2162cb00-2a00-11e9-88bd-b9d038c34d6f.png) However, it is not installed and is not in CogManager/cogs: ![image](https://user-images.githubusercontent.com/42872277/52355358-30497d80-2a00-11e9-8799-5a44ab23206f.png)
NeuroAssassin commented 2019-02-15 15:10:48 +01:00 (Migrated from github.com)

Looks like this issue may have just been with my bot, sorry that I forgot to update this. I deleted my bot's folders and re-isntalled my bot and it worked. Sinbad also tested it out on his bot and it worked. It may also have been due to me not using bundled_data_path correctly. Closing.

Looks like this issue may have just been with my bot, sorry that I forgot to update this. I deleted my bot's folders and re-isntalled my bot and it worked. Sinbad also tested it out on his bot and it worked. It may also have been due to me not using `bundled_data_path` correctly. Closing.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#2424
No description provided.