I am using BitBucket for my Django project and EC2 for cloud servers. My objective is that when I push a commit to a branch, BitBucket will make a call on the hook and the hook will update the code in EC2.
So far, when I commit, the hook is called but the code isn't being updated on the server. In my understanding, this is to do with permissions in Linux/Ubuntu 14.04.
I have tried to follow the link from Brandon Summers and further refinement of the same by going here. But it still doesn't work.
With the first link, I get this in the log:
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
chmod: cannot access '.git': No such file or directory
[Thu Jul 30 18:21:05.106127 2015] [:error] [pid 9736] [client 131.103.20.165:42727] PHP Notice: Undefined property: Deploy::$_data in /var/www/html/deploy_home.php on line 127
And the second link gives me this in console:
[Sat Aug 01 15:26:35.000824 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 144
[Sat Aug 01 15:26:35.000869 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: chmod(): No such file or directory in /var/www/html/deploy_repo.php on line 147
[Sat Aug 01 15:26:35.000924 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 152
[Sat Aug 01 15:26:35.001010 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 144
[Sat Aug 01 15:26:35.001034 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: chmod(): No such file or directory in /var/www/html/deploy_repo.php on line 147
[Sat Aug 01 15:26:35.001068 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 152
sh: 1: /usr/sbin/sendmail: not found
The second link's console output has something to do with unable to write to the log file but still the repo folder remains unchanged on EC2.
What am I missing here?
First, I guess you are missing the deploy directory in var/log. Try to create it manually. In this way at least you will have some log files to analyze.
Second, you haven't shown your script here but it's worth mentioning this script is using the older Bitbucket IP; if you haven't changed it yet, try to replace the IP in this line,
private $_repositoryIp = array ( '63.246.22.222');
with one of the new IP addresses you can find here.
Third, why all the effort when you can CI tools like Jenkins? Some useful posts: 1, 2.
Related
I am fairly new to Drupal.
I just got an already existing Drupal project and want to install it.
I copied it to: /var/www/html/myprojects/mydrupalproject
Then I got this error in my error.log from apache2:
[Thu May 03 17:55:41.603774 2018] [php7:notice] [pid 11604] [client
127.0.0.1:41930] PHP Notice: Constant DATE_RFC7231 already defined in /var/www/html/myprojects/mydrupalproject/includes/bootstrap.inc on
line 258, referer: http://127.0.0.1/myprojects/
[Thu May 03 17:55:41.604601 2018] [php7:error] [pid 11604] [client
127.0.0.1:41930] PHP Fatal error: require_once(): Failed opening required
'/var/www/html/myprojects/mydrupalproject/profiles/clusters_public/modules/contrib/apc/drupal_apc_cache.inc'
(include_path='.:/usr/share/php') in
/var/www/html/myprojects/mydrupalproject/includes/bootstrap.inc on
line 2632, referer: http://127.0.0.1/myprojects/
So I tried to use the original .htaccess info in case it was the problem but I still get exactly the same error in the log. Any help?
Failed opening required
'/var/www/html/myprojects/mydrupalproject/profiles/clusters_public/modules/contrib/apc/drupal_apc_cache.inc'
Does this file exist on your webserver and is it accessable? Are the correct file-rights set?
I inherited a CakePHP project and I am having issues getting the project running. I am running into these errors
[Fri Feb 02 00:05:35.920569 2018] [:error] [pid 536] [client 172.18.0.1:38124] PHP Warning: include(/home/tablereserv/web/tablereserv.com/public_html/lib/Cake/Error/ErrorHandler.php): failed to open stream: No such file or directory in /src/lib/Cake/Core/App.php on line 547
[Fri Feb 02 00:05:35.920638 2018] [:error] [pid 536] [client 172.18.0.1:38124] PHP Warning: include(): Failed opening '/home/tablereserv/web/tablereserv.com/public_html/lib/Cake/Error/ErrorHandler.php' for inclusion (include_path='.:/usr/share/php') in /src/lib/Cake/Core/App.php on line 547
[Fri Feb 02 00:05:35.920658 2018] [:error] [pid 536] [client 172.18.0.1:38124] PHP Warning: set_error_handler() expects the argument (ErrorHandler::handleError) to be a valid callback in /src/lib/Cake/Core/Configure.php on line 443
The file path that is trying to be included, /home/tablereserv/web/tablereserv.com/public_html/lib/Cake/Error/ErrorHandler.php does exist and the actual path to that file is /src/lib/Cake/Error/ErrorHandler.php
I have found some similar questions like the ones below, but none of the answers were particularly helpful
CakePHP ErrorHandler error
PHP Warning: include(/var/www/html/....../lib/Cake/Error/ErrorHandler.php): failed to open stream Error
When I print out the CAKE_CORE_INCLUDE_PATH variable, I get the correct path but something is obviously going wrong somewhere and I can’t seem to find it.
I also think I should mention that I set up a docker container to run the project in, I’m not sure if that could have an impact on it.
Any help would be greatly appreciated.
In my case, I found out that file mappings are stored in a file with a name similar to appname_cake_core_file_map. Once I deleted the cache file and ran the request again, a new mapping was generated with the correct path.
THis is my directory in making a zend framework album module
But I am getting this
[Thu Dec 21 14:45:23.609465 2017] [:error] [pid 15352] [client 127.0.0.1:56476] PHP Warning: include(/var/www/html/Profile/module/Album/config/module.config.php): failed to open stream: No such file or directory in /var/www/html/Profile/module/Album/Module.php on line 32
[Thu Dec 21 14:45:23.609500 2017] [:error] [pid 15352] [client 127.0.0.1:56476] PHP Warning: include(): Failed opening '/var/www/html/Profile/module/Album/config/module.config.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/Profile/module/Album/Module.php on line 32
Now I am confused why I am getting the error when I can see that the file exist in my folder.
I followed the instruction carefully from the docs and copied all the codes
I am wondering why I am getting this error and where I went wrong?
FYI:
Instead of naming zf2tutorial I named mine Profile just to clarify
Alright so. I have a relative simple task. Here is the fully functional working code of a query that does work. It works
<?php
$query = array(
'address'=>'https://mcapi.ca/query/94.12.141.113:25577/info'); //Grab statistics from URL.
$response = json_decode(file_get_contents($query['address']), true); //Decode the JSON response.
?>
It works. I've seen it work with my own two eyes.
The problem is now that I'm hosting the file. (obviously it has html code for the web page where the result of this query is called and displayed on the page(which also works)). When I host the file on my apache webserver which has been port forwarded and what have you - it's online. I go to the page.... scroll to the bottom and find that there are no results for this query. So my thinking is that apache is blocking links to other sites from within the files for some security reasons... sod that I want to see my results. So anyone know of such a setting? Maybe even a file that I can go and visit to change said setting?
Now what I want to know:
Is it the code?
if so how can I fix it?
Is it a setting in the webserver?
if so... you guessed it... how can I fix it?
and if it is none of the above... what is it?
Any and all help is much appreciated.
This is the error log as requested
[Sun Jan 01 14:18:42.055662 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\index.php on line 4
[Sun Jan 01 14:18:42.055662 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\index.php on line 4
[Sun Jan 01 14:18:46.248600 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\gallery.php on line 4, referer: http://localhost/
[Sun Jan 01 14:18:46.248600 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\gallery.php on line 4, referer: http://localhost/
[Sun Jan 01 14:18:47.697728 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\about.php on line 4, referer: http://localhost/gallery.php
[Sun Jan 01 14:18:47.697728 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\about.php on line 4, referer: http://localhost/gallery.php
[Sun Jan 01 14:18:48.495928 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\index.php on line 4, referer: http://localhost/about.php
[Sun Jan 01 14:18:48.495928 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\index.php on line 4, referer: http://localhost/about.php
[Sun Jan 01 14:34:21.958403 2017] [:error] [pid 5052:tid 1084] [client ::1:49819] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\index.php on line 4
[Sun Jan 01 14:34:21.958403 2017] [:error] [pid 5052:tid 1084] [client ::1:49819] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\index.php on line 4
Edit 1 - More error information, below:
I normally rebuild systems rather than upgrade them. I first rebuild my system with a virtual machine as a test. I am having a problem with mediawiki.
Working system:
Fedora 24, mediawiki 1.26.4-1 php 5.6.27-1
New system:
Fedora 25, mediawiki 1.27.1-1 php 7.0.13-1
I have followed the normal process to backup/restore the database and file system that has worked many times before, and ran the upgrade script. Now though, when I pull up the wiki home page I get this error:
Exception encountered, of type "Error"
[WDi085SSXW4b8deWoT2rTgAAAAA] /wiki/ Error from line 161 of /usr/share/mediawiki/includes/session/PHPSessionHandler.php: Class 'Wikimedia\PhpSessionSerializer' not found
Backtrace:
#0 /usr/share/mediawiki/includes/session/SessionManager.php(939): MediaWiki\Session\PHPSessionHandler->setManager(MediaWiki\Session\SessionManager, CachedBagOStuff, MediaWiki\Logger\LegacyLogger)
#1 /usr/share/mediawiki/includes/session/PHPSessionHandler.php(58): MediaWiki\Session\SessionManager->setupPHPSessionHandler(MediaWiki\Session\PHPSessionHandler)
#2 /usr/share/mediawiki/includes/session/PHPSessionHandler.php(120): MediaWiki\Session\PHPSessionHandler->__construct(MediaWiki\Session\SessionManager)
#3 /usr/share/mediawiki/includes/Setup.php(741): MediaWiki\Session\PHPSessionHandler::install(MediaWiki\Session\SessionManager)
#4 /usr/share/mediawiki/includes/WebStart.php(137): require_once(string)
#5 /usr/share/mediawiki/index.php(40): require(string)
#6 {main}
Any suggestions as to troubleshooting this would be appreciated.
Edit 1: More Information:
Note this problem also occurs trying to upgrade mediawiki in place on Fedora 24 as shown by the errors below:
On Screen:
Fatal error: Class 'Wikimedia\PhpSessionSerializer' not found in /usr/share/mediawiki/includes/session/PHPSessionHandler.php on line 161
In httpd log file:
[Fri Dec 02 09:34:26.160621 2016] [:error] [pid 3941] [client ::1:59474] PHP Fatal error: Class 'Wikimedia\\PhpSessionSerializer' not found in /usr/share/mediawiki/includes/session/PHPSessionHandler.php on line 161
[Fri Dec 02 09:34:26.160666 2016] [:error] [pid 3941] [client ::1:59474] PHP Stack trace:
[Fri Dec 02 09:34:26.160675 2016] [:error] [pid 3941] [client ::1:59474] PHP 1. {main}() /usr/share/mediawiki/index.php:0
[Fri Dec 02 09:34:26.160681 2016] [:error] [pid 3941] [client ::1:59474] PHP 2. require() /usr/share/mediawiki/index.php:40
[Fri Dec 02 09:34:26.160686 2016] [:error] [pid 3941] [client ::1:59474] PHP 3. require_once() /usr/share/mediawiki/includes/WebStart.php:137
[Fri Dec 02 09:34:26.160692 2016] [:error] [pid 3941] [client ::1:59474] PHP 4. MediaWiki\\Session\\PHPSessionHandler::install() /usr/share/mediawiki/includes/Setup.php:742
[Fri Dec 02 09:34:26.160697 2016] [:error] [pid 3941] [client ::1:59474] PHP 5. MediaWiki\\Session\\PHPSessionHandler->__construct() /usr/share/mediawiki/includes/session/PHPSessionHandler.php:120
[Fri Dec 02 09:34:26.160702 2016] [:error] [pid 3941] [client ::1:59474] PHP 6. MediaWiki\\Session\\SessionManager->setupPHPSessionHandler() /usr/share/mediawiki/includes/session/PHPSessionHandler.php:58
[Fri Dec 02 09:34:26.160708 2016] [:error] [pid 3941] [client ::1:59474] PHP 7. MediaWiki\\Session\\PHPSessionHandler->setManager() /usr/share/mediawiki/includes/session/SessionManager.php:939
The wiki move instructions on the MediaWiki site only work if you are moving from and to the EXACT same version of the software.
To do a move/upgrade of a wiki running on Fedora follow these steps:
Backup the wiki filesystem and database on the old system as you normally would.
On the new system copy the wiki filesystem /var/www/wiki directory into your apache accessible wiki directory (i.e. /var/www/html/wiki)
Restore the /images directory from the old system into the new
Restore and/or reinstall any plugins you had on the old system onto the new system
Restore the database on the new system
Run the maintenance database upgrade script
Test the restored wiki