Click here to register.
      
PBWG Banner


     Discuss > Install/Upgrade Help Goto page «Previous Page   1 2    Next Page»

Having problems with one upgrade only

User dannymk
Date 4/7/2008 9:22 pm
Views 2158
Rating 0    Rate [
|
]
Previous · Next
User Message
dannymk

I am running WebGUI 7.4.31 on three different systems.  However, on my notebook I am having the following problem:

=======================================================

Use of uninitialized value in subroutine entry at /usr/lib/perl5/site_perl/5.8.8/Config/JSON.pm line 135.
[Mon Apr 07 22:14:07 2008] [error] [client 127.0.0.1] malformed JSON string, neither array, object, number, string or atom, at character offset 0 ["(end of string)"] at /usr/lib/perl5/site_perl/5.8.8/Config/JSON.pm line 135.\n
=======================================================

I wrote this script to test the configuration files:

-----------------------------------------------------------------------------

use JSON;

die "Invalid number of arguments, you must pass config file\n" unless @ARGV;

[ -f $ARGV[0] ] || die "Can't open $ARGV[0]\n";

if (open(FILE, "<", $ARGV[0])) {
   local $/ = undef;
   my $json = <FILE>;
   close(FILE);
   my $conf = JSON->new->relaxed(1)->decode($json);
   die "Couldn't parse JSON in config file '$ARGV[0]'\n" unless ref $conf;

#   my $jsonPerl = from_json($conf);

   print qq|
      $jsonPerl
      Succesfully parsed configuration file: $ARGV[0]\n
   |;

} else {
   die "Cannot read config file: $ARGV[0]";
}
-------------------------------------------------------------------------------

When I uncomment the from_json sub above it fails with the same error found in the apache error log.

It seems some of my perl modules are borken.   However I have updated JSON.pm and have also used the solution in this thread:

http://www.webgui.org/install/upgrade_help/problem-installing-wre-0_8_1-rhel-5-ia32_tar_gz

Still have the same problem.

Anyone else seen this problem?

--- (Edited on 4/7/2008 10:22 pm [GMT-0400] by dannymk) ---



Back to Top
Rate [
|
]
 
 
colink

You have a typo/syntax error in one of your config files.  The most popular errors are trailing commas in the last entry of a list, or from rearranging a list so that internal nodes no longer have commas.

--- (Edited on 4/7/2008 10:04 pm [GMT-0500] by colink) ---



Back to Top
Rate [
|
]
 
 
dannymk

Yes, that is what I was thinking.  However, how do we validate a JSON structure in Perl/JavaScript/etc...?

When I run it without the from_json option the below script runs without a problem.

I have to look at the JSON module to figure out if the decode method does validation.  If it does then this call would fail as well: JSON->new->relaxed(1)->decode($json);

Thank you for your reply.

--- (Edited on 4/8/2008 7:52 am [GMT-0400] by dannymk) ---



Back to Top
Rate [
|
]
 
 
colink

JSON.pm doesn't have very good diagnostics.  You could try the newly released Test::JSON to write a new script to check those out.  It may have better diagnostics for telling you what's wrong.

Such a utility would be very helpful to lots of people.

--- (Edited on 4/8/2008 12:30 pm [GMT-0500] by colink) ---



Back to Top
Rate [
|
]
 
 
dannymk

OK, I refactored my test script as follows:

#======================================
use JSON;
use Test::JSON tests => 1;

die "Invalid number of arguments, you must pass config file\n" unless @ARGV;

[ -f $ARGV[0] ] || die "Can't open $ARGV[0]\n";

if (open(FILE, "<", $ARGV[0])) {
   local $/ = undef;
   my $json = <FILE>;
   close(FILE);

   is_valid_json $json, "json in config file $ARGV[0]!";

} else {
   die "Cannot read config file: $ARGV[0]";
}
#======================================

I ran the script againsts my WebGUI.conf file and I got the following result:

1..1
ok 1 - json in config file WebGUI.conf!

So it is good json as far as Test::JSON is concerned.  However when I run my WebGUI site I still get:

Use of uniitialized value in subroutine entry at /user.../JSON.pm line 135.
malformed JSON string, neither array, object, number, string or atom, at character offset 0 ["(end of string)"] at /usr...JSON.pm line 135.\n

I actually dropped the entire WebGUI database, recreated it with the "create.sql" script.  Used a default configuration file that came with webgui (just changed db info) and still got same error.

Another issue that happened while using Test::JSON is that it does not seem to like comments in the JSON structure.  As soon as I stripped all the #...  comments it passed the test.

Thank you for your help.

--- (Edited on 4/8/2008 3:11 pm [GMT-0400] by dannymk) ---



Back to Top
Rate [
|
]
 
 
colink

spectre.conf is also in JSON format.

If you like, please mask out usernames and passwords from your spectre.conf and webgui.conf files and post them here.  I'll take a look through them.

--- (Edited on 4/8/2008 2:21 pm [GMT-0500] by colink) ---



Back to Top
Rate [
|
]
 
 
dannymk

Hi Colin,
    I went through those files twice.  However there is always the possiblity that I missed something.  That is why I wrote the testing script.  I am at work so I cannot send the files.  However, I will send them tonight when I get home.

Thank you for your support.

--- (Edited on 4/8/2008 3:39 pm [GMT-0400] by dannymk) ---



Back to Top
Rate [
|
]
 
 
dannymk

Spectre.conf

--------------------------------------------------------------------------------

{
"ip" : "127.0.0.1",
"port" : 32133,
"maxWorkers" : 3,
"timeBetweenRunningWorkflows" : 2,
"suspensionDelay" : 60,
"webguiPort" : 80,
"ignoreEnvProxy" : 0
}

Webgui.conf file:

-----------------------------------------------------------------------------------

{
"sitename" : [ "localhost" ],
"sslEnabled" : "0",
"cookieName" : "wgSession",
"gateway" : "/",
"extrasURL" : "/extras",
"extrasPath" : "/opt/WebGUI/www/extras",
"uploadsURL" : "/uploads",
"uploadsPath" : "/opt/WebGUI/www/uploads",
"richEditorsUseAssetUrls" : "1",
"passthruUrls" : ["/auction", "/auctionx"],
"cacheType" : "WebGUI::Cache::FileCache",
"disableCache" : "0",
"dsn" : "DBI:mysql:webgui;host=localhost",
"dbuser" : "webgui",
"dbpass" : "mypassword",
"authMethods" : [ "LDAP", "WebGUI" ],
"paymentPlugins" : ["ITransact","Cash"],
"shippingPlugins" : ["ByPrice", "ByWeight", "PerTransaction"],
"templateParsers" : ["WebGUI::Asset::Template::HTMLTemplate"],
"defaultTemplateParser" : "WebGUI::Asset::Template::HTMLTemplate",
"searchIndexerPlugins" : {
    "txt" : "/bin/cat",
    "readme" : "/bin/cat",
    "html" : "/bin/cat",
    "htm" : "/bin/cat"
    },
"maximumAssets" : "0",
"assets" : [
    "WebGUI::Asset::Snippet",
    "WebGUI::Asset::Redirect",
    "WebGUI::Asset::FilePile",
    "WebGUI::Asset::Wobject::Article",
    "WebGUI::Asset::Wobject::Collaboration",
    "WebGUI::Asset::Wobject::DataForm",
    "WebGUI::Asset::Wobject::Calendar",
    "WebGUI::Asset::Wobject::EventManagementSystem",
    "WebGUI::Asset::Wobject::HttpProxy",
    "WebGUI::Asset::Wobject::Navigation",
    "WebGUI::Asset::Wobject::Matrix",
    "WebGUI::Asset::Wobject::Poll",
    "WebGUI::Asset::Wobject::Product",
    "WebGUI::Asset::Wobject::ProjectManager",
    "WebGUI::Asset::Wobject::SQLReport",
    "WebGUI::Asset::Wobject::Search",
    "WebGUI::Asset::Wobject::Survey",
    "WebGUI::Asset::Wobject::TimeTracking",
    "WebGUI::Asset::Wobject::WeatherData",
    "WebGUI::Asset::Wobject::MultiSearch",
    "WebGUI::Asset::Wobject::StockData",
    "WebGUI::Asset::Wobject::SyndicatedContent",
    "WebGUI::Asset::Wobject::InOutBoard",
    "WebGUI::Asset::File::ZipArchive",
    "WebGUI::Asset::Wobject::WSClient",
    "WebGUI::Asset::Wobject::SQLForm"
    ],
"utilityAssets" : [
    "WebGUI::Asset::Template",
    "WebGUI::Asset::RichEdit",
    "WebGUI::Asset::File::Image",
    "WebGUI::Asset::File"
   ],
"assetContainers" : [
    "WebGUI::Asset::Wobject::Layout",
    "WebGUI::Asset::Wobject::Folder",
    "WebGUI::Asset::Wobject::Dashboard",
    "WebGUI::Asset::Wobject::MessageBoard",
    "WebGUI::Asset::Wobject::WikiMaster"
    ],
"enableSaveAndCommit" : "0",
"assetToolbarUiLevel" : {
    "edit" : "1",
    "delete" : "1",
    "cut" : "1",
    "copy" : "1",
    "shortcut" : "5",
    "editBranch" : "9",
    "lock" : "5",
    "export" : "9",
    "changeUrl" : "9",
    "promote" : "3",
    "demote" : "3",
    "manage" : "5",
    "revisions" : "5",
    "view" : "1"
    },
"soapHttpHeaderOverride" : "0",
"enableStreamingUploads" : "0",
"macros" : {
    "#" : "Hash_userId",
        "/" : "Slash_gatewayUrl",
        "@" : "At_username",
        "AOIHits" : "AOIHits",
        "AOIRank" : "AOIRank",
        "AdminBar" : "AdminBar",
        "AdminText" : "AdminText",
        "AdminToggle" : "AdminToggle",
    "AdSpace" : "AdSpace",
        "AssetProxy" : "AssetProxy",
        "CanEditText" : "CanEditText",
        "D" : "D_date",
        "EditableToggle" : "EditableToggle",
        "Extras" : "Extras",
        "FetchMimeType" : "FetchMimeType",
        "FileUrl" : "FileUrl",
        "GroupAdd" : "GroupAdd",
        "GroupDelete" : "GroupDelete",
        "GroupText" : "GroupText",
        "H" : "H_homeLink",
        "International" : "International",
        "L" : "L_loginBox",
        "LastModified" : "LastModified",
        "LoginToggle" : "LoginToggle",
        "Page" : "Page",
        "PageTitle" : "PageTitle",
        "PageUrl" : "PageUrl",
        "RandomAssetProxy" : "RandomAssetProxy",
    "RandomThread" : "RandomThread",
        "RootTitle" : "RootTitle",
        "Spacer" : "Spacer",
        "SubscriptionItem" : "SubscriptionItem",
        "SubscriptionItemPurchaseUrl" : "SubscriptionItemPurchaseUrl",
        "Thumbnail" : "Thumbnail",
        "User" : "User",
        "a" : "a_account",
        "c" : "c_companyName",
        "e" : "e_companyEmail",
        "r" : "r_printable",
        "u" : "u_companyUrl"
    },
"ldapAlias" : {   
        "firstName" : "givenName",
    "lastName" : "sn",
    "email" : "mail",
    "companyName" : "o"   
    },
"spectreSubnets" : [ "127.0.0.1/32" ],
"spectreIp" : "127.0.0.1",
"spectrePort" : "32133",
"workflowActivities" : {
   "None" : [
       "WebGUI::Workflow::Activity::DecayKarma",
       "WebGUI::Workflow::Activity::TrashClipboard",
       "WebGUI::Workflow::Activity::CleanTempStorage",
       "WebGUI::Workflow::Activity::CleanFileCache",
       "WebGUI::Workflow::Activity::CleanLoginHistory",
       "WebGUI::Workflow::Activity::ArchiveOldThreads",
       "WebGUI::Workflow::Activity::TrashExpiredEvents",
       "WebGUI::Workflow::Activity::CreateCronJob",
       "WebGUI::Workflow::Activity::DeleteExpiredSessions",
       "WebGUI::Workflow::Activity::ExpireGroupings",
       "WebGUI::Workflow::Activity::PurgeOldAssetRevisions",
       "WebGUI::Workflow::Activity::ExpireSubscriptionCodes",
       "WebGUI::Workflow::Activity::PurgeOldTrash",
       "WebGUI::Workflow::Activity::GetSyndicatedContent",
       "WebGUI::Workflow::Activity::ProcessRecurringPayments",
       "WebGUI::Workflow::Activity::SyncProfilesToLdap",
       "WebGUI::Workflow::Activity::SummarizePassiveProfileLog",
       "WebGUI::Workflow::Activity::SendQueuedMailMessages",
       "WebGUI::Workflow::Activity::CleanDatabaseCache",
       "WebGUI::Workflow::Activity::CalendarUpdateFeeds",
       "WebGUI::Workflow::Activity::NotifyAdminsWithOpenVersionTags"
   ],
   "WebGUI::User" : [
      "WebGUI::Workflow::Activity::CreateCronJob",
      "WebGUI::Workflow::Activity::NotifyAboutUser"
   ],
   "WebGUI::VersionTag" : [
      "WebGUI::Workflow::Activity::CommitVersionTag",
      "WebGUI::Workflow::Activity::RollbackVersionTag",
      "WebGUI::Workflow::Activity::TrashVersionTag",
      "WebGUI::Workflow::Activity::CreateCronJob",
      "WebGUI::Workflow::Activity::UnlockVersionTag",
      "WebGUI::Workflow::Activity::NotifyAboutVersionTag",
      "WebGUI::Workflow::Activity::RequestApprovalForVersionTag",
      "WebGUI::Workflow::Activity::ExportVersionTagToHtml"
   ]
},
"graphingPlugins" : [
    "WebGUI::Image::Graph::Pie",
    "WebGUI::Image::Graph::XYGraph::Bar",
    "WebGUI::Image::Graph::XYGraph::Line"
    ],
"runOnLogin" : "",
"runOnLogout" : ""
}

--- (Edited on 4/8/2008 9:44 pm [GMT-0400] by dannymk) ---



Back to Top
Rate [
|
]
 
 
colink

I'm running out of ideas.

It thinks that the config file is empty.

--- (Edited on 4/9/2008 11:42 am [GMT-0500] by colink) ---



Back to Top
Rate [
|
]
 
 
dannymk

Which config file?

--- (Edited on 4/9/2008 12:57 pm [GMT-0400] by dannymk) ---



Back to Top
Rate [
|
]
 
 
     Discuss > Install/Upgrade Help Goto page «Previous Page   1 2    Next Page»




Re: Overriding inbox emails by JT - Sun @ 07:35pm

Re: Buying documentation from plainblack by knowmad - Sun @ 07:28pm

Re: Lincense Issues by knowmad - Sun @ 07:15pm

Re: Overriding inbox emails by knowmad - Sun @ 07:12pm

Re: Advanced Search template by knowmad - Sun @ 06:57pm

Re: The goal by dionak - Sun @ 01:20pm

Re: How to connect a Profile Field to a User Group? by LoopSetShop - Sun @ 11:13am

Re: How to connect a Profile Field to a User Group? by LoopSetShop - Sun @ 10:45am

Re: How to connect a Profile Field to a User Group? by perlDreamer - Sun @ 10:32am

How to connect a Profile Field to a User Group? by LoopSetShop - Sun @ 09:45am

Re: WebGUI Drinks by bernd - Sun @ 07:58am

Re: RSVP function in WebGUI? by pvanthony - Sun @ 03:26am

Smoketest For nightly_2008-09-07 by Visitor - Sun @ 01:47am