Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmm update breaks xmm #18

Open
anfelor opened this issue May 13, 2021 · 2 comments
Open

xmm update breaks xmm #18

anfelor opened this issue May 13, 2021 · 2 comments

Comments

@anfelor
Copy link

anfelor commented May 13, 2021

I recently used xmm again and it worked well. Version 0.8.0, but I don't know which version the json data had (probably around 1 year old). I then wrote xmm update and now xmm seems broken:

$ xmm install Deck16.pk3
Installing map: Deck16.pk3
Found in: default
...137%, 0 MB, 27594 KB/s, 0 seconds passed. Done.

$ xmm update
Updating default sources json...
...132%, 0 MB, 28777 KB/s, 0 seconds passed. Done.

$ xmm search deck
Failed.

$ xmm install Deck16.pk3
Installing map: Deck16.pk3
Deck16.pk3 already exists.
continue? [y/N] y
Traceback (most recent call last):
  File "/home/anton/.local/bin/xmm", line 8, in <module>
    sys.exit(main())
  File "/home/anton/.local/lib/python3.8/site-packages/xmm/cli.py", line 110, in main
    server.library.install_map(pk3_name=args.pk3, repository_name=args.repository)
  File "/home/anton/.local/lib/python3.8/site-packages/xmm/library.py", line 167, in install_map
    maps_json = repo.get_packages()
  File "/home/anton/.local/lib/python3.8/site-packages/xmm/repository.py", line 450, in get_packages
    maps = json.loads(data)['data']
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@FAFDK
Copy link

FAFDK commented Feb 22, 2022

I also have problems with the latest build.

Latest Ubuntu 20.04.3 LTS 64bit server.
user@ubuntu-xonotic:~/xonotic/data$ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

------- searching for Dusty works -------

user@ubuntu-xonotic:~/xonotic/data$` xmm search dusty

Could not find a repo file. Using maplist shipped with release. For the latest maps, run xmm update.
Using repo 'default'
Searching for packages with the following criteria:
bsp: dusty

SymDusty_v2r3.pk3 [symdusty_v2r3]
http://dl.xonotic.co/SymDusty_v2r3.pk3

dusty-rbi.pk3 [dusty]
http://dl.xonotic.co/dusty-rbi.pk3

dusty.pk3 [dusty]
http://dl.xonotic.co/dusty.pk3

dusty_symB.pk3 [dusty_symB]
http://dl.xonotic.co/dusty_symB.pk3

..etc

------- installing Dusty does not -------

user@ubuntu-xonotic:~/xonotic/data$ xmm install dusty_v2r1.pk3
Installing map: dusty_v2r1.pk3
Found in: default

Traceback (most recent call last):
File "/home/server/.local/bin/xmm", line 8, in
sys.exit(main())
File "/home/user/.local/lib/python3.8/site-packages/xmm/cli.py", line 110, in main
server.library.install_map(pk3_name=args.pk3, repository_name=args.repository)
File "/home/user/.local/lib/python3.8/site-packages/xmm/library.py", line 177, in install_map
util.download_file(filename_with_path=pk3_with_path, url=url, use_curl=self.conf['default']['use_curl'], overwrite=overwrite)
File "/home/user/.local/lib/python3.8/site-packages/xmm/util.py", line 77, in download_file
urllib.request.urlretrieve(url, os.path.expanduser(filename_with_path), reporthook)
File "/usr/lib/python3.8/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 1383, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.8/urllib/request.py", line 1357, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -5] No address associated with hostname>
user@ubuntu-xonotic:~/xonotic/data$

------- trying to update -------

user@ubuntu-xonotic:~/xonotic/data$ xmm update
Updating default sources json...
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/xmm/repository.py", line 416, in update_repo_data
util.download_file(self.api_data_file, url=self.api_data_url, use_curl=self.conf['default']['use_curl'], overwrite=True)
File "/home/user/.local/lib/python3.8/site-packages/xmm/util.py", line 77, in download_file
urllib.request.urlretrieve(url, os.path.expanduser(filename_with_path), reporthook)
File "/usr/lib/python3.8/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 410: Gone

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/user/.local/bin/xmm", line 8, in
sys.exit(main())
File "/home/user/.local/lib/python3.8/site-packages/xmm/cli.py", line 284, in main
server.repositories.update_all()
File "/home/user/.local/lib/python3.8/site-packages/xmm/repository.py", line 167, in update_all
repo.update_repo_data()
File "/home/user/.local/lib/python3.8/site-packages/xmm/repository.py", line 419, in update_repo_data
raise RepositoryUpdateError
TypeError: init() missing 1 required positional argument: 'reason'
user@ubuntu-xonotic:~/xonotic/data$

------- uninstalling XMM -------

user@ubuntu-xonotic:~/xonotic/data$ pip3 uninstall xmm

Found existing installation: xmm 0.8.0
Uninstalling xmm-0.8.0:
Would remove:
/home/user/.local/bin/xmm
/home/user/.local/bin/xmm.bash
/home/user/.local/bin/xmm.zsh
/home/user/.local/lib/python3.8/site-packages/xmm-0.8.0.dist-info/*
/home/user/.local/lib/python3.8/site-packages/xmm/*
Proceed (y/n)? y
Successfully uninstalled xmm-0.8.0
user@ubuntu-xonotic:~/xonotic/data$

------- update -------

Ty for your work, but it needs an update to support 0.8.2. I think.

.. or what do I do wrong?

@z
Copy link
Owner

z commented Mar 3, 2024

The reason it breaks on update is because this is still using the old URL "xonotic.co", the current URL is "xonotic.fps.gratis". So it's downloading some bad data and confusing xmm.

When you tell xmm to update, it reaches out to the server to get the maps.json data:

Update your URLs in the ~/.xmm/sources.json

https://github.com/z/xonotic-map-manager/blob/master/config/example.sources.json#L5

and ~/.xmm.ini:

https://github.com/z/xonotic-map-manager/blob/master/config/xmm.ini#L8-L9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants