metanorma / stepmod-utils

Tools for working on the STEPmod repository.
1 stars 0 forks source link

`stepmod2mn.jar` downloading issue #211

Open Intelligent2013 opened 12 months ago

Intelligent2013 commented 12 months ago

Source ticket: https://github.com/metanorma/stepmod2mn/issues/106

OS: Windows 10

The command:

bundle exec stepmod-srl-migrate --srl-schemas-dir schemas --srl-docs-dir documents --stepmod-dir iso-10303-stepmod-wg12

ends with the error:

D:\Work\Metanorma\repositories\iso-10303-srl>bundle exec stepmod-srl-migrate --srl-schemas-dir schemas --srl-docs-dir documents --stepmod-dir iso-10303-stepmod-wg12
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
Downloading `stepmod2mn.jar` to `D:/Work/Metanorma/repositories/iso-10303-srl/stepmod2mn-1.25.jar`.
C:/tools/ruby31/lib/ruby/3.1.0/fileutils.rb:541:in `rename': Permission denied @ rb_file_s_rename - (C:/Users/TestUser/AppData/Local/Temp/down-net_http20231204-16896-fpy9g, D:/Work/Metanorma/repositories/iso-10303-srl/stepmod2mn-1.25.jar) (Errno::EACCES)
        from C:/tools/ruby31/lib/ruby/3.1.0/fileutils.rb:541:in `block in mv'
        from C:/tools/ruby31/lib/ruby/3.1.0/fileutils.rb:1577:in `block in fu_each_src_dest'
        from C:/tools/ruby31/lib/ruby/3.1.0/fileutils.rb:1593:in `fu_each_src_dest0'
        from C:/tools/ruby31/lib/ruby/3.1.0/fileutils.rb:1575:in `fu_each_src_dest'
        from C:/tools/ruby31/lib/ruby/3.1.0/fileutils.rb:532:in `mv'
        from C:/tools/ruby31/lib/ruby/gems/3.1.0/gems/stepmod-utils-0.4.2/exe/stepmod-srl-migrate:95:in `download_stepmod2mn'
        from C:/tools/ruby31/lib/ruby/gems/3.1.0/gems/stepmod-utils-0.4.2/exe/stepmod-srl-migrate:109:in `<top (required)>'
        from C:/tools/ruby31/lib/ruby/gems/3.1.0/bin/stepmod-srl-migrate:25:in `load'
        from C:/tools/ruby31/lib/ruby/gems/3.1.0/bin/stepmod-srl-migrate:25:in `<main>'
C:/tools/ruby31/lib/ruby/gems/3.1.0/bin/stepmod-srl-migrate: warning: Exception in finalizer #<Tempfile::Remover:0x0000025f84786c30 @pid=16896, @tmpfile=#<File:C:/Users/TestUser/AppData/Local/Temp/down-net_http20231204-16896-fpy9g (closed)>>
C:/tools/ruby31/lib/ruby/3.1.0/tempfile.rb:265:in `unlink': Permission denied @ apply2files - C:/Users/TestUser/AppData/Local/Temp/down-net_http20231204-16896-fpy9g (Errno::EACCES)
        from C:/tools/ruby31/lib/ruby/3.1.0/tempfile.rb:265:in `call'

The file C:/Users/TestUser/AppData/Local/Temp/down-net_http20231204-16896-fpy9g exists and I can move it into D:/Work/Metanorma/repositories/iso-10303-srl/stepmod2mn-1.25.jar manually.

I've tried the Command Prompt wirh Administative rights also - the same issue.

ronaldtse commented 12 months ago

I'm not sure why there is this issue. This could be due to the down gem.

In any case, you can add the --stepmod2mn-path stepmod2mn-1.25.jar option, and it would not download the JAR again as long as you have this file in your current directory.

Intelligent2013 commented 12 months ago

In any case, you can add the --stepmod2mn-path stepmod2mn-1.25.jar option, and it would not download the JAR again as long as you have this file in your current directory.

@ronaldtse thank you, it works for me.

ronaldtse commented 12 months ago

Thank you @Intelligent2013 , we'll see how we can fix this issue now...