You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
I tried to capture the content of a modules-db but that one failed.
./ml test capture --modules-db=sarepta-modules
Retrieving source and REST config from sarepta-modules...
ERROR: No such file or directory @ rb_sysopen - /var/folders/hj/45wrdfss2ll8jhqyy0c2r32c24hql1/T/d20141103-65428-1kxoe0j/src/app/config/config.xqy
ERROR: ["/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1024:in initialize'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1024:inopen'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1024:in block in save_files_to_fs'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1017:ineach'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1017:in save_files_to_fs'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:946:incapture'", "deploy/lib/ml.rb:140:in `
'"]
The mentioned folder exists but is completely empty.
Talked to Geert about this and apparently the folders are not created before writing the file.
This is probably caused by this function in server_config.rb:
def save_files_to_fs(target_db, target_dir)
# Get the list of URIs. We get them in order because Ruby's Dir.mkdir
# command doesn't have a -p option (create parent).
I changed this (line 1024):
File.open("#{target_dir}#{uri}", 'wb') { |file| file.write(r.body) }
into this (thanks to Geert!)
path = "#{target_dir}#{uri}"
parentdir = File.dirname "#{target_dir}#{uri}"
FileUtils.mkdir_p(parentdir) unless File.exists?(parentdir)
File.open("#{path}", 'wb') { |file| file.write(r.body) }
and then it worked again.
Same should apply to line 1006
The text was updated successfully, but these errors were encountered:
…Issue marklogic-community#298
Improved the fix for Issue marklogic-community#223 based on feedback received.
Also fixes Issue marklogic-community#298 since it protects against the error condition.
In addition some of the Capture help content was clarified to reflect the implementation.
grtjn
added a commit
to grtjn/roxy
that referenced
this issue
Jul 6, 2015
I tried to capture the content of a modules-db but that one failed.
'"]./ml test capture --modules-db=sarepta-modules
Retrieving source and REST config from sarepta-modules...
ERROR: No such file or directory @ rb_sysopen - /var/folders/hj/45wrdfss2ll8jhqyy0c2r32c24hql1/T/d20141103-65428-1kxoe0j/src/app/config/config.xqy
ERROR: ["/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1024:in
initialize'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1024:in
open'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1024:inblock in save_files_to_fs'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1017:in
each'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:1017:insave_files_to_fs'", "/Users/pkester/Development/StandardNorway/capture/deploy/lib/server_config.rb:946:in
capture'", "deploy/lib/ml.rb:140:in `The mentioned folder exists but is completely empty.
Talked to Geert about this and apparently the folders are not created before writing the file.
This is probably caused by this function in server_config.rb:
def save_files_to_fs(target_db, target_dir)
# Get the list of URIs. We get them in order because Ruby's Dir.mkdir
# command doesn't have a -p option (create parent).
I changed this (line 1024):
File.open("#{target_dir}#{uri}", 'wb') { |file| file.write(r.body) }
into this (thanks to Geert!)
path = "#{target_dir}#{uri}"
parentdir = File.dirname "#{target_dir}#{uri}"
FileUtils.mkdir_p(parentdir) unless File.exists?(parentdir)
File.open("#{path}", 'wb') { |file| file.write(r.body) }
and then it worked again.
Same should apply to line 1006
The text was updated successfully, but these errors were encountered: