Page 1 of 1

ERROR IN DEPLOY

Posted: December 1st, 2019, 3:21 pm
by hannesrr
Dear Josh,

I have a trouble with the app deploy. The CsPRO Deploy Application show Deploy Successfull. But, in the web dashboard the app it's not showing.

Could you help, The log show these lines:

Stack trace:
#0 /home/gruplvbk/public_html/csweb/src/api/app/helpers.php(492): validateDecodedJSON(Object(Silex\Application), Object(stdClass), '#/definitions/A...')
#1 /home/gruplvbk/public_html/csweb/src/api/src/CSPro/Controllers/AppsController.php(131): validateEncodedJSON(Object(Silex\Application), Object(stdClass), '#/definitions/A...')
#2 [internal function]: CSPro\Controllers\AppsController->updateApp(Object(Silex\Application), Object(Symfony\Component\HttpFoundation\Request), 'ProgramaIngreso...')
#3 /home/gruplvbk/public_html/csweb/vendor/symfony/http-kernel/HttpKernel.php(139): call_user_func_array(Array, Array)
#4 /home/gruplvbk/public_html/csweb/vendor/symfony/http-kernel/HttpKernel.php(62): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#5 /home/gruplvbk/public_html/csweb/vendor/silex/silex/src/Silex/Application.php(586): S in /home/gruplvbk/public_html/csweb/src/api/app/helpers.php on line 505
[01-Dec-2019 15:10:31 America/Lima] PHP Fatal error: Uncaught Error: Call to undefined function apc_fetch() in /home/gruplvbk/public_html/csweb/src/api/app/helpers.php:505
Stack trace:
#0 /home/gruplvbk/public_html/csweb/src/api/app/helpers.php(492): validateDecodedJSON(Object(Silex\Application), Object(stdClass), '#/definitions/A...')
#1 /home/gruplvbk/public_html/csweb/src/api/src/CSPro/Controllers/AppsController.php(131): validateEncodedJSON(Object(Silex\Application), Object(stdClass), '#/definitions/A...')
#2 [internal function]: CSPro\Controllers\AppsController->updateApp(Object(Silex\Application), Object(Symfony\Component\HttpFoundation\Request), 'CUNAMAS')
#3 /home/gruplvbk/public_html/csweb/vendor/symfony/http-kernel/HttpKernel.php(139): call_user_func_array(Array, Array)
#4 /home/gruplvbk/public_html/csweb/vendor/symfony/http-kernel/HttpKernel.php(62): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#5 /home/gruplvbk/public_html/csweb/vendor/silex/silex/src/Silex/Application.php(586): Symfony\Comp in /home/gruplvbk/public_html/csweb/src/api/app/helpers.php on line 505


Regards,

Hannes RodrĂ­guez
PerĂș

Re: ERROR IN DEPLOY

Posted: December 2nd, 2019, 6:36 am
by josh
Can you save your deploy and send us the deploy spec file (csds) file? Either post it here or send it to cspro@lists.census.gov.

Re: ERROR IN DEPLOY

Posted: December 2nd, 2019, 7:44 am
by hannesrr
Dear Josh,
Attached to this post I send you the specf file.


Also, when I tried to synchronize, an error appears. The log is the one that follows:

01/12/2019 18:23:26.719 INFO: Connect to server http://xxxxx.com/csweb/api/ as user admin
01/12/2019 18:23:26.720 INFO: Connect to server http://xxxxx.com/csweb/api/
01/12/2019 18:23:26.720 INFO: Set listener
01/12/2019 18:23:26.720 INFO: AndroidHttpConnection::setListener
01/12/2019 18:23:26.720 INFO: AndroidHttpConnection::setListener complete
01/12/2019 18:23:26.720 INFO: On start
01/12/2019 18:23:26.733 INFO: Call connect
01/12/2019 18:23:26.734 INFO: AndroidHttpConnection::doRequest
01/12/2019 18:23:26.734 INFO: AndroidHttpConnection::methodAndroidHttpConnectionRequest
01/12/2019 18:23:27.370 INFO: AndroidHttpConnection::methodAndroidHttpConnectionRequest completed
01/12/2019 18:23:27.371 INFO: AndroidHttpConnection: no exception copying headers
01/12/2019 18:23:27.371 INFO: AndroidHttpConnection::doRequest completed with code 200
01/12/2019 18:23:27.372 INFO: AndroidHttpConnection::doRequest
01/12/2019 18:23:27.372 INFO: AndroidHttpConnection::methodAndroidHttpConnectionRequest
01/12/2019 18:23:27.562 INFO: AndroidHttpConnection::methodAndroidHttpConnectionRequest completed
01/12/2019 18:23:27.563 INFO: AndroidHttpConnection: no exception copying headers
01/12/2019 18:23:27.563 INFO: AndroidHttpConnection::doRequest completed with code 200
01/12/2019 18:23:27.563 INFO: Server API version: 1.1
01/12/2019 18:23:27.563 INFO: Connection successful. Server id: http://www.xxxxx.com/csweb/api/
01/12/2019 18:23:27.585 INFO: AndroidHttpConnection::setListener
01/12/2019 18:23:27.585 INFO: AndroidHttpConnection::setListener complete
01/12/2019 18:23:27.589 INFO: Syncing data: DataCunaMas.csdb direction PUT universe ""
01/12/2019 18:23:27.592 INFO: First time PUT with this server
01/12/2019 18:23:27.596 INFO: Total new/modified cases since last sync: 1
01/12/2019 18:23:27.600 INFO: AndroidHttpConnection::doRequest
01/12/2019 18:23:27.601 INFO: AndroidHttpConnection::methodAndroidHttpConnectionRequest
01/12/2019 18:23:27.839 INFO: AndroidHttpConnection::methodAndroidHttpConnectionRequest completed
01/12/2019 18:23:27.839 INFO: AndroidHttpConnection: no exception copying headers
01/12/2019 18:23:27.839 INFO: AndroidHttpConnection::doRequest completed with code 200
01/12/2019 18:23:27.839 ERROR: Server response missing revision header 0xaa2ae6a0
01/12/2019 18:23:27.839 ERROR: HEADERS:
01/12/2019 18:23:27.839 ERROR: null:HTTP/1.1 200 OK
01/12/2019 18:23:27.839 ERROR: Content-Type:text/html; charset=UTF-8
01/12/2019 18:23:27.839 ERROR: Date:Sun, 01 Dec 2019 23:23:28 GMT
01/12/2019 18:23:27.839 ERROR: Server:Apache
01/12/2019 18:23:27.839 ERROR: Vary:Accept-Encoding
01/12/2019 18:23:27.839 ERROR: X-Android-Received-Millis:1575242607838
01/12/2019 18:23:27.839 ERROR: X-Android-Response-Source:NETWORK 200
01/12/2019 18:23:27.839 ERROR: X-Android-Selected-Protocol:http/1.1
01/12/2019 18:23:27.839 ERROR: X-Android-Sent-Millis:1575242607603
01/12/2019 18:23:27.840 ERROR: X-Powered-By:PHP/7.2.25
01/12/2019 18:23:27.840 ERROR: BODY:
01/12/2019 18:23:27.840 ERROR: <br />
<b>Fatal error</b>: Uncaught Error: Call to undefined function apc_fetch() in /home/gruplvbk/public_html/csweb/src/api/app/helpers.php:27
Stack trace:
#0 /home/gruplvbk/public_html/csweb/src/api/src/CSPro/Controllers/DictionaryController.php(412): loadDictionary(Object(Silex\Application), 'DICCUNAMAS_DICT')
#1 [internal function]: CSPro\Controllers\DictionaryController-&gt;addOrUpdateCases(Object(Silex\Application), Object(Symfony\Component\HttpFoundation\Request), 'DICCUNAMAS_DICT')
#2 /home/gruplvbk/public_html/csweb/vendor/symfony/http-kernel/HttpKernel.php(139): call_user_func_array(Array, Array)
#3 /home/gruplvbk/public_html/csweb/vendor/symfony/http-kernel/HttpKernel.php(62): Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#4 /home/gruplvbk/public_html/csweb/vendor/silex/silex/src/Silex/Application.php(586): Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#5 /home/gruplvbk/public_html/csweb/vendor/silex/silex/src in <b>/home/gruplvbk/public_html/csweb/src/api/app/helpers.php</b> on line <b>27</b><br />

01/12/2019 18:25:15.443 ERROR: Error syncing data: 100121

Re: ERROR IN DEPLOY

Posted: December 2nd, 2019, 8:43 am
by josh
If you are able to update PHP modules on the server please try installing the APCu Backwards Compatiblity Module (https://pecl.php.net/package/apcu_bc). It seems that with newer versions of PHP that module is required even if you already have APCu installed.

If you do not have access to the server to add that module then edit the file www/csweb/src/api/app/helpers.php and replace apc_fetch with apcu_fetch and apc_store with apcu_store. There should be four places in that file where you need to do that replacement:

Around line 25:

Code: Select all

	if(extension_loaded('apcu') && ini_get('apc.enabled')){
		$bFound = false;
    	$dict  = apc_fetch($dictName, $bFound);
    	if($bFound == true)
    		return $dict;
	}
Around line 47:

Code: Select all

		if(extension_loaded('apcu') && ini_get('apc.enabled')){
			 apc_store($dictName, $dict);
		}
Around line 510:

Code: Select all

	if(extension_loaded('apcu') && ini_get('apc.enabled')){
		$bFound = false;
		$schema  = apc_fetch($uri, $bFound);
	}
Around line 520:

Code: Select all

		if(extension_loaded('apcu') && ini_get('apc.enabled')){
			apc_store($uri, $schema);
		}
We will fix this in the next version of CSWeb.

Re: ERROR IN DEPLOY

Posted: December 4th, 2019, 7:35 am
by hannesrr
Dear,

Could you help me to say the line exactly please?
Attached you can find de helpers.php file.

Thank you so much.

Re: ERROR IN DEPLOY

Posted: December 4th, 2019, 8:50 am
by josh
Try this

Re: ERROR IN DEPLOY - SOLUTION

Posted: December 4th, 2019, 9:32 pm
by hannesrr
Josh!!

Excelent solution! All it's ok now!

Now, CSWeb it's working correctly!!

Thak you so much.

Regards,

Hannes