I'm trying to use duplicity to backup files to a Swift Object Storage service offered by RunAbove. The name of the container is "backup" and it has a pseudo folder named "web" inside which I want to place backups.
Duplicity version: 0.6.24
Python version: 2.7.3
python-keystoneclient 1.0.0
python-swiftclient 2.3.1
After setting the necessary environment variables I have tried the following commands:
duplicity --no-encryption /var/www swift://backup/web/
Returns the following error:
Listing of 'backup/web/' failed (attempt 1): JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Then I tried:
duplicity --no-encryption --file-prefix web/ /var/www swift://backup
Which returns python errors:
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
No signatures found, switching to full backup.
Traceback (most recent call last):
File "/usr/bin/duplicity", line 1509, in <module>
with_tempdir(main)
File "/usr/bin/duplicity", line 1503, in with_tempdir
fn()
File "/usr/bin/duplicity", line 1352, in main
do_backup(action)
File "/usr/bin/duplicity", line 1478, in do_backup
full_backup(col_stats)
File "/usr/bin/duplicity", line 545, in full_backup
globals.backend)
File "/usr/bin/duplicity", line 420, in write_multivol
sig_outfp.to_partial()
File "/usr/lib/python2.7/dist-packages/duplicity/dup_temp.py", line 168, in to_partial
self.tdp.rename(self.dirpath.append(self.partname))
File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 612, in rename
os.rename(self.name, new_path.name)
OSError: [Errno 2] No such file or directory
How do I backup files to a pseudo folder in OpenStack Swift using duplicity?
This issue is fixed in duplicity v0.7.08 (see http://duplicity.nongnu.org/CHANGELOG)
Merged in lp:~ghoz/duplicity/swift-prefix
adds the abiliy to use path in the swift backend, in order to have multiple
backups to the same container neatly organized.
Related
I have a weird error message using the download_and_convert_mnist_m.py script from github https://github.com/tensorflow/models/tree/master/research/domain_adaptation/datasets.
The command I am using from the models/research/ folder is
python domain_adaptation/datasets/download_and_convert_mnist_m.py --dataset_dir=~/dsn_data/
The error message is
Traceback (most recent call last):
File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 237, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 233, in main
run(FLAGS.dataset_dir)
File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 201, in run
os.path.join(dataset_dir, 'mnist_m', 'mnist_m_train'))
File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 177, in _get_filenames
for filename in os.listdir(dataset_dir):
OSError: [Errno 2] No such file or directory: '~/dsn_data/mnist_m/mnist_m_train'
I tried several ways:
without creating the path before and without having the data before
create the path before and let it empty
download and unpack data from https://drive.google.com/drive/folders/0B_tExHiYS-0vR2dNZEU4NGlSSW8 at the specified path as described here https://github.com/tensorflow/models/tree/master/research/domain_adaptation
I use
Ubuntu 16.04
Python 2.7
tensorflow 1.4.1
What else can I do.. looks like an pretty simple error but I have no more ideas.
I solved it. The correct command is without the equal sign.
python domain_adaptation/datasets/download_and_convert_mnist_m.py --dataset_dir=~/dsn_data/
This is the error I get in VSCode when running docker-compose.
PS D:\Work\Imho\Api> docker-compose -f docker-compose.yml up
Creating network "api_default" with the default driver
Pulling ignite (apacheignite/ignite:latest)...
latest: Pulling from apacheignite/ignite
5040bd298390: Pulling fs layer
fce5728aad85: Pulling fs layer
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose\cli\main.py", line 68, in main
File "compose\cli\main.py", line 118, in perform_command
File "compose\cli\main.py", line 926, in up
File "compose\project.py", line 401, in up
File "compose\service.py", line 305, in ensure_image_exists
File "compose\service.py", line 1001, in pull
File "compose\progress_stream.py", line 37, in stream_output
File "codecs.py", line 370, in write
File "site-packages\colorama\ansitowin32.py", line 40, in write
File "site-packages\colorama\ansitowin32.py", line 141, in write
File "site-packages\colorama\ansitowin32.py", line 169, in write_and_convert
File "site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
IOError: [Errno 0] Error
Failed to execute script docker-compose
docker-compose.yml:
version: '3'
services:
ignite:
image: apacheignite/ignite
This error only happens on one of my 3 machines, so I have no idea what causes it. Resetting to factory defaults or reinstalling docker and vscode doesn't help. Without docker compose the image is pulling and then working fine. All the machines are on windows 10 and latest stable docker installed.
Here is the issue I opened on github. It appeared that this behavior only occurs in VSCode powershell console, but not in regular powershell console. The solution with changing encoding suggested there didn't help.
Solution: Update to 1803 on Windows 10. If you can't update, use external command prompt.
The same thing happens to me with Python scripts. Apparently, this is a Windows Update issue:
https://github.com/Microsoft/vscode/issues/36630#issuecomment-359969098
Edit: My workaround due to my company restricting updates is to use external terminal in VS Code
I am very new to Python and Django and is currently busy learning myself through tutorials on www.djangoproject.com. I am using PyCharm and working on OS X El Capitan. I have imported a project from GitHub and created a virtual environment for the project interpreter based on Python 3.5.1. In the vm I installed django.
I then activated the vm.
Now.. I started by trying to execute simple commands in the terminal like python manage.py startapp deonapp and python manage.py runserver but each time I get an error which I pasted below.. What did I miss? I cannot seem to find the /log/ directory?
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/config.py", line 558, in configure
handler = self.configure_handler(handlers[name])
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/config.py", line 731, in configure_handler
result = factory(**kwargs)
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py", line 1008, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py", line 1037, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/deon/Documents/PyCharmProjects/Developments/deonproject/log/debug.log'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/deon/Documents/PyCharmProjects/Developments/deonproject/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/Users/deon/Documents/PyCharmProjects/Developments/deonproject/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 341, in execute
django.setup()
File "/Users/deon/Documents/PyCharmProjects/Developments/deonproject/venv/lib/python3.5/site-packages/django/__init__.py", line 22, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/Users/deon/Documents/PyCharmProjects/Developments/deonproject/venv/lib/python3.5/site-packages/django/utils/log.py", line 75, in configure_logging
logging_config_func(logging_settings)
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/config.py", line 795, in dictConfig
dictConfigClass(config).configure()
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/config.py", line 566, in configure
'%r: %s' % (name, e))
ValueError: Unable to configure handler 'file': [Errno 2] No such file or directory: '/Users/deon/Documents/PyCharmProjects/Developments/deonproject/log/debug.log'
I managed to fix it. The log directory was not created because it was excluded in the .gitignore file. I completely forgot to look what was excluded :). I created the directory manually and now it passed the error.
Deon
you can add this in setting.py
LOG_PATH = os.path.join(BASE_DIR, 'log')
or
if not os.path.join(LOG_PATH):
os.mkdir(LOG_PATH)
Other answers can be true in most of cases, But In my case log directory was created, But log dir had permission issue to my user. simply using chown to my user (my case www-data) solved the problem.
(In my case):
sudo chown www-data:www-data /var/log/django/
use your username:user-group instead of www-data:www-data and your log dir instead of /var/log/django/.
Traceback says, that it's no "log" directory.
Create directory with name log in path /Users/deon/Documents/PyCharmProjects/Developments/deonproject/
Create empty file .gitkeep
After creating .gitkeep file, push it to GitHub
I'm developing a web-browser extension, and have found a tool which will allow me to publish the extension for all browsers from a single code-base. The tool is called Open Forge and is developed by Trigger.io.
The setup instructions listed in the Open Forge ReadMe (included in the link above) involve creating and configuring a new python environment. I've been able to create and activate a new python environment in my project directory, however the command to configure the environment (pip install -r requirements.txt) generates the following exception:
Exception:
Traceback (most recent call last):
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\commands\install.py", line 347, in run
root=options.root_path,
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\req\req_set.py", line 497, in install
and req.installed_version in distribute_req):
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\pkg_resources.py", line 2851, in __contains__
return self.specifier.contains(item, prereleases=True)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\specifiers.py", line 651, in contains
item = parse(item)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\version.py", line 41, in parse
return Version(version)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\version.py", line 202, in __init__
match = self._regex.search(version)
TypeError: expected string or buffer
The process hangs on line 17 of the requirements.txt document. The line in question is:
PyHamcrest==1.6
I have also attempted this process on Unix (OS X) and encountered the same error.
I'm able to complete the process successfully by specifying the latest version of PyHamcrest (1.8) in requirements.txt. I've never used PyHamcrest before, and don't feel comfortable speculating as to why 1.8 works while 1.6 does not.
This issue occurs when deploying either by the Google App Engine Launcher and via the command-line using appcfg.py
I have tried:
- Changing version - (doesn't work)
- Deleting version from when the issue stated (24 hours ago- around the time there was some Python issues on Google) - Doesn't work
- Install one of my other applications (works)
I have been banging my head against the wall on this for 24 hours and can't get any updates onto production
-------- Output -------------------------
Scanning files on local disk.
Cloning 10 static files.
Cloning 98 application files.
Compilation starting.
Compilation completed.
Starting deployment.
Checking if deployment succeeded.
Will check again in 1 seconds.
............
Will check again in 60 seconds.
Checking if deployment succeeded.
Will check again in 60 seconds.
Checking if deployment succeeded.
Will check again in 60 seconds.
Checking if deployment succeeded.
2012-02-24 07:38:36,362 WARNING appcfg.py:1948 Version still not ready to serve, aborting.
2012-02-24 07:38:36,363 ERROR appcfg.py:2178 An unexpected error occurred. Aborting.
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2164, in DoUpload
app_summary = self.Commit()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 1949, in Commit
raise Exception('Version not ready.')
Exception: Version not ready.
Rolling back the update.
Password for XXXXX#XXXXXX: Traceback (most recent call last):
File "google_appengine/appcfg.py", line 101, in <module>
run_file(__file__, globals())
File "google_appengine/appcfg.py", line 97, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3935, in <module>
main(sys.argv)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3926, in main
result = AppCfgApp(argv).Run()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2497, in Run
self.action(self)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3692, in __call__
return method()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2915, in Update
self.UpdateVersion(rpcserver, self.basepath, appyaml)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2904, in UpdateVersion
self.options.max_size)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2164, in DoUpload
app_summary = self.Commit()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 1949, in Commit
raise Exception('Version not ready.')
Exception: Version not ready.
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 1 ***