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

Multiple errors when trying to start wahoomc gui #258

Closed
Oxmaster opened this issue Sep 26, 2024 · 7 comments
Closed

Multiple errors when trying to start wahoomc gui #258

Oxmaster opened this issue Sep 26, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Oxmaster
Copy link

I don't have patience for these kinds of things, trying to get commands to do their things.

First error:

(gdal-user) C:\Users\pawel\wahooMapsCreatorData>python -m wahoomc gui
INFO:Last run was with version None, deleting files of C:\Users\pawel\wahooMapsCreatorData\_tiles directory due to breaking changes.
INFO:Last run was with version None, deleting files of C:\Users\pawel\wahooMapsCreatorData\_download\maps directory due to breaking changes.
INFO:Last run was with version None, deleting files of C:\Users\pawel\wahooMapsCreatorData\_tiles directory due to breaking changes.
INFO:# Need to download Osmosis application for Windows
INFO:--------------------------------------------------------------------------------
INFO:# Downloading osmosis.bat file
ERROR:! failed to find C:\Users\pawel\wahooMapsCreatorData\_download\tooling_win\Osmosis\bin\osmosis.bat

it couldn't find osmosis.bat because it was downloading it to
C:\Users\pawel\wahooMapsCreatorData\_download\tooling_win\Osmosis\osmosis-0.49.2 and not

C:\Users\pawel\wahooMapsCreatorData\_download\tooling_win\Osmosis
no biggie, moved the files from 0.49.2 folder to folder up a tree.

Second error:

(gdal-user) C:\Users\pawel\wahooMapsCreatorData>python -m wahoomc gui
INFO:Last run was with version None, deleting files of C:\Users\pawel\wahooMapsCreatorData\_tiles directory due to breaking changes.
INFO:Last run was with version None, deleting files of C:\Users\pawel\wahooMapsCreatorData\_download\maps directory due to breaking changes.
INFO:Last run was with version None, deleting files of C:\Users\pawel\wahooMapsCreatorData\_tiles directory due to breaking changes.
INFO:# Need to download Osmosis mapwriter plugin
INFO:--------------------------------------------------------------------------------
INFO:# Downloading mapsforge-map-writer-0.21.0-jar-with-dependencies.jar file
ERROR:! failed download URL: https://search.maven.org/remotecontent?filepath=org/mapsforge/mapsforge-map-writer/0.21.0\mapsforge-map-writer-0.21.0-jar-with-dependencies.jar

ok, no biggie I will download it manually. I've downloaded the .jar from https://repo1.maven.org/maven2/org/mapsforge/mapsforge-map-writer/0.21.0/ and copied it to every folder that is in \wahooMapsCreatorData\_download but it still won't work

Running on Windows 11 with admin privlidges anaconda prompt.

@Oxmaster Oxmaster added the bug Something isn't working label Sep 26, 2024
@treee111
Copy link
Owner

Hi @Oxmaster,
thanks for opening the issue and thanks for trying to use wahooMapsCreator!
I need to look into this, it's a long time ago since I opened the GUI version. I'll try to reproduce the first steps (i.e. deleting tooling before).

Have you tried if a small country works via CLI? E.g.

conda activate gdal-user
python -m wahoomc cli -co malta

@Oxmaster
Copy link
Author

Hi @Oxmaster, thanks for opening the issue and thanks for trying to use wahooMapsCreator! I need to look into this, it's a long time ago since I opened the GUI version. I'll try to reproduce the first steps (i.e. deleting tooling before).

Have you tried if a small country works via CLI? E.g.

conda activate gdal-user
python -m wahoomc cli -co malta

Neither work, same error on both.

@treee111
Copy link
Owner

Hi @Oxmaster, thanks for opening the issue and thanks for trying to use wahooMapsCreator! I need to look into this, it's a long time ago since I opened the GUI version. I'll try to reproduce the first steps (i.e. deleting tooling before).
Have you tried if a small country works via CLI? E.g.

conda activate gdal-user
python -m wahoomc cli -co malta

Neither work, same error on both.

OK, than I have to reproduce it on a "empty" machine in the next days

@i-am-tc
Copy link

i-am-tc commented Oct 12, 2024

I also encountered both bugs.

The first bug's work around is as per original post.

Perhaps adding the follow at line 131 of downloader.py (note the additional import of shutil) might help?

        # Extract and move files
        with zipfile.ZipFile(osmosis_zip_path, 'r') as zip_ref:
            zip_ref.extractall(USER_TOOLING_WIN_DIR)
        
        # Move contents from extracted folder to Osmosis folder
        extracted_folder = os.path.join(USER_TOOLING_WIN_DIR, 'osmosis-0.49.2')
        osmosis_folder = get_tooling_win_path('Osmosis', in_user_dir=True)
        for item in os.listdir(extracted_folder):
            s = os.path.join(extracted_folder, item)
            d = os.path.join(osmosis_folder, item)
            if os.path.isdir(s):
                shutil.copytree(s, d, dirs_exist_ok=True)
            else:
                shutil.copy2(s, d)
        
        # Clean up
        shutil.rmtree(extracted_folder)
        os.remove(osmosis_zip_path)`

The second bug's work around is to download it manually and move it to the right folder (see below). See

mapwriter_plugin_path = os.path.join(USER_TOOLING_WIN_DIR,
:

C:\Users\BLAH_BLAH_BLAH\wahooMapsCreatorData_download\tooling_win\Osmosis\lib\default

BLAH_BLAH_BLAH : sample user on a Windows install. Do change accordingly.

Given that this is free software, wasn't difficult to read some code and figure out what's wrong. All the more easier now with GPTs - free & paid.

@Oxmaster

@treee111
Copy link
Owner

Thanks for your additional information @i-am-tc. I have to setup a Windows machine first then I can dig into this.
I need to reproduce and test/debug on the machine itself, only by looking onto code I can't figure it out atm.

Will keep you both updated in this issue!

@treee111 treee111 self-assigned this Oct 14, 2024
@treee111
Copy link
Owner

treee111 commented Oct 14, 2024

Ok, I was able to figure it out using a Virtual Machine.
You both are correct, I was able to reproduce these two issues:

  1. Failing download of mapwriter plugin was caused due to backslashes in a URL
  2. Osmosis v0.49.2 might not been working at all since upgrading, due to the download side but more due to not beeing able to use mapwriter plugin (at least in my installation)

I worked on both topics and created a alpha version for testing purposes.
Feel free to install via pip install wahoomc==4.2.1a1 pip install wahoomc==4.2.1a3 and run the tool again.

There shouldn't be any other manual tasks, wahooMapsCreator should do the thing by itself.
For reference: The alpha version is build based on branch reset-osmosis-win

Happy to hear from your tryouts @i-am-tc and @Oxmaster !

@treee111
Copy link
Owner

should be fixed now with https://github.com/treee111/wahooMapsCreator/releases/tag/v4.3.0
Feel free to tryout and open another issue if you still have problems running wahooMapsCreator.

Thanks again for opening and commenting - we made wahooMapsCreator better/more robust ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants