Rex icon indicating copy to clipboard operation
Rex copied to clipboard

rexify for module installation doesn't work

Open elisdg opened this issue 7 years ago • 3 comments

(debian 9.5 / perl 5.24 / rex 1.6.0) Running the command rexify --use="Rex::Ext::Backup" would result in:

malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/local/bin/rexify line 384.

Online I just found this workaround (manually copying the repo): https://groups.google.com/forum/#!topic/rex-users/794tvV45OxY

I did a little bit of poking in the rexify script, but (with my low level perl knowledge) didn't succeed. I don't see anything wrong with the JSON at http://modules.rexify.org/api/1.6/get/dep/Rex::Ext::Backup

#~line 368
  print "Getting dependencies for $name...\n";             
                                                           
 my $myOrigServerString= sprintf ($DEPEND_SERVER,$name); 
 #my $myServerString= to_json($myOrigServerString);      
 my $myServerString= $myOrigServerString;                
 print $myServerString ."\n";                              
 #my $myServerString= encode_json($$myLegacyServerString); 
                                                           
my $myJson = get( $myServerString);                        
print $myJson ."\n";                                       
=pod                                                       
my @testJson;                                              
$testJson[0] = qq\{"ok":"0"}\;                             
my $myRevJson = \@testJson;                                
use HTML::Entities;                                        
  my $deps = decode_entities( $myRevJson );                
=cut                                                       
my $deps = decode_json( $myJson );                         

elisdg avatar Jul 25 '18 06:07 elisdg

What I found is:

  • the https facility seems broken
  • and some API's do not work well too, see https://github.com/RexOps/Rex/issues/1185

KDr2 avatar Aug 14 '18 09:08 KDr2

I install the recipes in this way:

$cd $PROJECT_HOME
$mkdir lib -p
$git clone https://github.com/RexOps/rex-recipes.git  # ensure it's on branch 1.4
$ln -sf $PWD/rex-recipes/Rex/ lib/
$ls
lib  Rexfile  rex-recipes

KDr2 avatar Aug 25 '18 14:08 KDr2

FTR: The service providing the central module catalog went unmaintained, and the hosting server is already decommissioned. Moreover the centralized module repository idea didn't work out well (see deprecation notice), so there's probably no chance restoring the service in the exact same way.

The following ideas were popping up in the community around this issue so far:

  1. deprecate rexify functions related to online module search/install
  2. use MetaCPAN to search/install external modules
  3. fall back to git-based search/install

Currently the main idea is to follow point 2, with the remark that the modules from rex-recipes repo were not published on CPAN by their authors. So perhaps point 3 can help with that during a transitional period (install from git is already implemented).

ferki avatar May 25 '20 07:05 ferki