RexOps / Rex

Rex, the friendly automation framework
https://www.rexify.org
716 stars 223 forks source link

rexify for module installation doesn't work #1201

Open elisdg opened 6 years ago

elisdg commented 6 years ago

(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 );                         
KDr2 commented 6 years ago

What I found is:

KDr2 commented 6 years ago

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
ferki commented 4 years ago

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).