Unable to Restore the Backup File in PgAdmin4 - admin

I have been using "PgAdmin 4" and i am unable to restore the backup file. it gives me an error
"object of type 'bool' has no len() pgadmin restore"
My Log file detail is given below :
"2018-08-01 11:06:38,943: ERROR pgadmin: object of type 'bool' has no len()
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\10\pgAdmin 4\web\pgadmin\tools\restore\__init__.py", line 327, in create_restore_job
*args
File "C:\Program Files\PostgreSQL\10\pgAdmin 4\web\pgadmin\tools\restore\__init__.py", line 84, in __init__
if arg and len(arg) >= 2 and arg[:2] == '--':
TypeError: object of type 'bool' has no len()
2018-08-01 11:08:58,861: ERROR pgadmin: object of type 'bool' has no len()
Traceback (most recent call last):
File "C:\Program Files\PostgreSQL\10\pgAdmin 4\web\pgadmin\tools\restore\__init__.py", line 327, in create_restore_job
*args
File "C:\Program Files\PostgreSQL\10\pgAdmin 4\web\pgadmin\tools\restore\__init__.py", line 84, in __init__
if arg and len(arg) >= 2 and arg[:2] == '--':
TypeError: object of type 'bool' has no len() "
Thanks

I had the same problem when I tried to restore a TAR file created by own pg Admin. To solve this problem I needed to rename the file with a ".tar" in the end of file (example: my-backup.tar).
I though this very strange, in spite of himself had generated the file.

Related

How to install `distro-info===0.18ubuntu0.18.04.1`?

Trying to modernize an old Django project (2.2), and its requirements.txt (generated via pip freeze) has some lines that make pip install throw fits:
distro-info===0.18ubuntu0.18.04.1
I interpreted the errors I got for the first one (see the error output in its entirety at the bottom) as the version string not conforming to PEP-518, but it doesn't even mention the === operator. This SO thread, What are triple equal signs and ubuntu2 in Python pip freeze?, has a similar issue, but:
The errors they got is different (ValueError as opposed to my ParseError).
The solution was to upgrade pip, but I'm already using the latest one.
Now, pip install distro-info works so should I just go with that?
update: The project I'm trying to update has been conceived around 2020, and according to the PyPI history of distro-info, it had a 0.10 release in 2013 and a 1.0 in 2021. Could this anything have to do with the weird pip freeze output? (From this PyPI support issue.)
The error:
ERROR: Exception:
Traceback (most recent call last):
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3021, in _dep_map
return self.__dep_map
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/core.py", line 1141, in parse_string
raise exc.with_traceback(None)
pip._vendor.pyparsing.exceptions.ParseException: Expected string_end, found '(' (at char 12), (line:1, col:13)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3101, in __init__
super(Requirement, self).__init__(requirement_string)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py", line 104, in __init__
raise InvalidRequirement(
pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'(===0.18'": Expected string_end
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
status = run_func(*args)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
return func(self, options, args)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 400, in run
requirement_set = resolver.resolve(
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
result = self._result = resolver.resolve(
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 373, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 203, in _get_updated_criteria
for requirement in self._p.get_dependencies(candidate=candidate):
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 237, in get_dependencies
return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 237, in <listcomp>
return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 247, in iter_dependencies
requires = self.dist.iter_dependencies() if with_requires else ()
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_internal/metadata/pkg_resources.py", line 216, in iter_dependencies
return self._dist.requires(extras)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2736, in requires
dm = self._dep_map
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3033, in _compute_dependencies
reqs.extend(parse_requirements(req))
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3094, in parse_requirements
yield Requirement(line)
File "/home/old-django-project/.venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3103, in __init__
raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Parse error at "'(===0.18'": Expected string_end
Looks like your library was discontinued. In PyPi, infact, I can see there are only 1.0 and 0.10. If you need that specific version, then you need to setup a manual installation, downloading the source here. Either, you can upgrade your version and try to refactor any possible problem coming after!
In case, if you need to dockerize your app, setting up a script for the manual installation of a library is simple.

NEOS solver bonmin

did anyone know why this error happen? other solver such as cbc works fine but when sent to NEOS, I got the following error in command line
Traceback (most recent call last):
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 409, in
process_data(df, df)
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 191, in process_data
pyomo_tool(df,road_year, pit_year, road_estimated_cost, pit_estimated_cost, road_tot_budget, pit_tot_budget,
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 291, in pyomo_tool
solver.solve(model)
File "C:\Python31\lib\site-packages\pyomo\opt\results\container.py", line 284, in getattr
raise AttributeError("Unknown attribute "+str(name)+"' for object with type "+str(type(self))) AttributeError: Unknown attribute solve' for object with type <class 'pyomo.opt.results.results_.SolverResults'>

rmats2sashimiplot: error retrieving files from chr#

I'm having the following error when trying to run rmats2sashimiplot:
Reading sample label: Abi3bp Controls-1 IncLevel: 0.89
Error retrieving files from chr16: invalid reference chr16
Are you sure chr16 appears in your BAM file?
Aborting plot...
Traceback (most recent call last):
File "/data/home/bt21020/.conda/envs/py.2.7/lib/python2.7/site-packages/MISO/misopy/sa
shimi_plot/sashimi_plot.py", line 293, in
main()
File "/data/home/bt21020/.conda/envs/py.2.7/lib/python2.7/site-packages/MISO/misopy/sa
shimi_plot/sashimi_plot.py", line 289, in main
plot_label=plot_label)
File "/data/home/bt21020/.conda/envs/py.2.7/lib/python2.7/site-packages/MISO/misopy/sa
shimi_plot/sashimi_plot.py", line 160, in plot_event
plot_label=plot_label)
File "/data/home/bt21020/.conda/envs/py.2.7/lib/python2.7/site-packages/MISO/misopy/sa
shimi_plot/plot_utils/plot_gene.py", line 838, in plot_density_from_file
plot_title=plot_title)
File "/data/home/bt21020/.conda/envs/py.2.7/lib/python2.7/site-packages/MISO/misopy/sa
shimi_plot/plot_utils/plot_gene.py", line 392, in plot_density
junction_log_base=junction_log_base)
TypeError: 'AxesSubplot' object is not iterable
mv: cannot stat ‘/data/scratch/bt21020/2022-05-16-sashimi/result/HGS2/test/Sashimi_plot/
chr16:56592604:56592681:+#chr16:56594462:56594536:+#chr16:56642489:56642560:+.pdf’: No s
uch file or directory
I'm using bam files from rmats output so does this mean I have to edit the bam files for the chr column? Please help thank you.

Error when i try to OpenRAM, AttributeErrir: 'NoneType' object has no attribute 'startswith'

I get the error. how should i fix it?
ERROR: runTest (30_openram_test.openram_test)
Traceback (most recent call last): File "/home/leepil/OpenRAM-master/compiler/tests/30_openram_test.py", line 23, in runTest
globals.init_openram("config_20_{0}".format(OPTS.tech_name))
enter code here
File "/home/leepil/OpenRAM-master/compiler/tests/../globals.py", line 113, in init_openram
import_tech()
File "/home/leepil/OpenRAM-master/compiler/tests/../globals.py", line 314, in import_tech
__import__(filename)
File "/home/leepil/OpenRAM-master/technology/setup_scripts/setup_openram_freepdk45.py", line 16, in <module>
PDK_DIR=os.path.abspath(os.environ.get("FREEPDK45"))
File "/home/leepil/PycellStudio3/plat_linux_gcc44x_64/3rd/lib/python2.7/posixpath.py", line 367, in abspath
if not isabs(path):
File "/home/leepil/PycellStudio3/plat_linux_gcc44x_64/3rd/lib/python2.7/posixpath.py", line 61, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
For info, I am on OpenRAM-Master (Tech is freepdk45) & Python version 2.7.9.
See the detail error message below. Thx!

Scrapy cannot handle bad headers properly [ScrapyHTTPPageGetter,client] Unhandled Error

Environment:
Scrapy 0.16.2
Twisted-12.2.0
python 2.7
macosx-10.6
Okey here is my problem:
I try to run
scrapy shell http://aaa.17domn.com/bt9/file.php/MERH77V.html
Error:
[ScrapyHTTPPageGetter,client] Unhandled Error
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/internet/selectreactor.py", line 150, in _doReadOrWrite
why = getattr(selectable, method)()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/internet/tcp.py", line 202, in doRead
return self._dataReceived(data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/internet/tcp.py", line 208, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/protocols/basic.py", line 564, in dataReceived
why = self.lineReceived(line)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Scrapy-0.16.2-py2.7.egg/scrapy/core/downloader/webclient.py", line 50, in lineReceived
return HTTPClient.lineReceived(self, line.rstrip())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/web/http.py", line 450, in lineReceived
self.extractHeader(self._header)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/web/http.py", line 406, in extractHeader
key, val = header.split(':',1)
exceptions.ValueError: need more than 1 value to unpack
I found the solution from https://groups.google.com/forum/#!msg/scrapy-users/xFKo8ggzPxs/VXDl3CZ4V4cJ
They describe this is caused by twisted. Then I patched function extractHeader in /twisted/web/http.py from http://twistedmatrix.com/trac/ticket/2842. Its WORKS
BUT BUT, Hold on NOt yet!!!
I run another web
scrapy shell http://www1.wkdown.info/fs3/file.php/M994ATR.html
Error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/internet/defer.py", line 551, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Scrapy-0.16.2-py2.7.egg/scrapy/core/downloader/webclient.py", line 122, in _build_response
status = int(self.status)
ValueError: invalid literal for int() with base 10: 'html'
I think something happen on response headers. Scrapy cannot handle it well.
Any idea?
Thank you!