I just started building a Drupal site with Azure. I installed the Azure Blob module and everything works correctly (local environment) including displaying and uploading images to the storage blob. However, after deploying the site and database to a staging server, all the images are broken. I made sure the images are present since I've uploaded them while working locally. I'm unable to locate what the actual issue is.
The module hasn't been updated for a while and I spent some time digging through the code for the module, but without avail. I was wondering if anyone has run into similar issues and could perhaps point me to the right direction. Thanks in advance.
I was finally able to figure it out what the problem is. I was unable to display or upload images when everything is deployed to the Azure, unsure of what the exact problem was I went through the process of trial and error by eliminating possible causes one by one. It all comes down to making a change in the module itself. In the file "azure_blob.streamwrappers.inc", go to the function createStorageClient. You need to specify a BlobEndpoint in the configuration.
if (!isset(self::$clients[$scheme])) {
// Obtain user configuration from database
$configuration = ctools_export_crud_load('azure_blob', $scheme);
if (isset($configuration)) {
// #todo Use shared access signature to specify a specific blob endpoint
$connection_string = 'DefaultEndpointsProtocol=https;AccountName=' .
$configuration->account . ';AccountKey=' . $configuration->primary_key . ';BlobEndpoint=http://[StorageName].blob.core.windows.net/';
self::$clients[$scheme] =
ServicesBuilder::getInstance()->createBlobService($connection_string);
// Store other configuration properties in client object
self::$clients[$scheme]->blob_container = $configuration->blob_container;
self::$clients[$scheme]->cache_control = $configuration->cache_control;
}
else {
throw new Exception(t('Invalid storage scheme "#stream"', array('#stream' => $scheme)));
}
}
return self::$clients[$scheme];
I hope this helps whomever that runs into the same issue in the future. I was literally pulling my hair out trying to find a solution for 2 days :)
Related
I did everything according to points 1-5 as indicated in the Readme.MD
https://github.com/ckfinder/ckfinder-laravel-package#configuring-authentication
On site authors say: At this point you should see the connector JSON response after navigating to the <APP BASE URL>/ckfinder/connector?command=Init address. Authentication for CKFinder is not configured yet, so you will see an error response saying that CKFinder is not enabled
I opened link
http://127.0.0.1:8000/ckfinder/connector?command=Init
And have JSON error:
{"error":{"number":110,"message":"Unknown error."}}
Can someone help me? How to find reason of trouble? i google many sites and there is no desicion
Are you using PHP 8+?
For me the issue was a deprecated line in the package itself.
I fixed this error by changing vendor\ckfinder\ckfinder-laravel-package\_connector\ArgumentResolver.php line 65
from
if ($reflectionClass = $param->getClass()) {
to
if ($reflectionClass = new \ReflectionClass($param->getType()->getName())) {
because getClass() is deprecated in PHP 8.0.3, It works fine for me now.
Note: Do keep in mind that it's not good to change things inside the vendor folder!
I am running Vagrant locally on my Windows PC, Vagrant is running CentOS and having a weird issue with something working fine locally on my Vagrant box, but getting a 500 error when pushing the code to my staging server.
Within my admin I have the following URL which grabs the id from the URL and uses that within a function to add some rows to a particular database table.
http://www.mysite.co.uk.192.168.0.155.xip.io/admin/settings/bulkclassroom/id/19312
This URL above in turn goes to my 'Settings' Controller and runs the follow function
public function actionBulkclassroom($id = null)
{
if (isset($id)) {
$model = new OrganisationClassroom();
$model->bulkAssignTeacherAllClassrooms($id);
}
}
This in turn uses the 'OrganisationClassroom' model and uses the following function to assign a teacher to all classrooms.
public function bulkAssignTeacherAllClassrooms($user_id = null)
{
if (!$user_id) return false;
$classes = OrganisationClassroom::model()->currentUserOrganisation()->findAll();
OrganisationClassroomsTeachersPivot::model()->deleteAll('user_id =:user_id ', array(':user_id'=> $user_id));
foreach($classes as $class)
{
$pivot = new OrganisationClassroomsTeachersPivot();
$pivot->classroom_id = $class->classroom_id;
$pivot->user_id = $user_id;
$pivot->save(false);
}
}
The code is pretty much self-explanatory and is working as expected when I run the code locally on my Vagrant box, however when I push the code to my staging server online I get the following error.
include(user_id.php) [function.include]: failed to open stream: No such file or directory
I am unsure why this is happening, nowhere in my code do I have an include(user_id.php) (I have done a search to double-check)
As the code & database tables are the same the issue can only be somehow related to my staging server setup somehow - can anyone suggest what is going on with this & how I can fix it?
For the record - this works 100% locally on my Vagrant box - it only gives the error on my staging server (has the same code & database structure) - the really odd thing is there is nowhere in my site do I have any includes referencing a file called user_id.php (I have double checked and there is definitely NO file called user_id.php on my local or remote staging server.
Any ideas?
check your file points to correct location that you have specified, mainly issue is with incorrect path to your file.
I have installed Drupal on Windows 2012 R2 (IIS 8.5) on my DEV and TEST servers. They are clean / out-of-the-box installations. My DEV environment is working fine, but I can’t install modules on my TEST environment. I’ve gone over the installations trying to figure out what is different, but I’ve been beating my head against the wall and they seem identical. Clearly they are not.
Problem
When installing a module, I get this error:
Installation failed! See the log below for more information.
module_filter
•Error installing / updating
•File Transfer failed, reason: /mysite.com/sites/all/modules is outside of the /mysite.com
(Note this is from the Authorize.php)
The permission on my public download folder seems fine – the module uploads and extracts just fine.
My public file system path is set to “sites/default/files” and my temporary directory is set to “sites/default/files/tmp”.
I can't figure out why it thinks the modules folder is outside of my root site!
I’m stumped. Any help would be appreciated!!!
Thanks
Tom Hundley
Solution
As it turns out, this is a bug in Drupal running on IIS. The checkPath method of filetransfer.inc. is case-sensitive, so depending on how you setup the site in IIS, it might work or it might not work! This explained why things work on my DEV environment but not TEST.
Edit the checkPath method in includes/filetransfer/filetransfer.inc and add this code:
$full_path = strtolower($full_path);
$full_jail = strtolower($full_jail);
just before the path comparison:
if ($full_jail !== $full_path) { ... }
FIXED!
References
A HUGE thanks goes out to "sevenares" for posting the solution to this problem here:
https://www.drupal.org/node/1071870#comment-8507091
I hope this helps someone.
Happy coding,
Tom Hundley
I really need your help. Actually, my journey begin with the installation Drupal and some modules. After a couple of days I suddenly get an issue "500 Internal Server Error".
I asked my hosting provider why this happened, he said "That because of the file .htaccess and you should add to this file php display error". So i did this and I get a new issue :
"Fatal error: Call to undefined function menu_load() in ...
/public_html/includes/menu.inc on line 579."
By the way, that's line 579
else {$return = $function($value);}
P.S: I am a beginner in PHP. I like Drupal a lot and want to study Drupal in further and create cool sites, but this problem...
need to figure out what function it's trying to call first.
change the line
else {$return = $function($value);}
to
else {echo $function;exit;$return = $function($value);}
Here are few tips:
make sure your Drupal core has all the files in the right place (especially menu module),
make sure your imported database is in UTF-8 format,
upgrade your Drupal core to the latest version (drush fr && drush up drupal)
clear all your caches (drush -y cc all), including your memcached (killall memcached),
rebuild your registry by using [Registry Rebuild][1],
if you're using modules which are implementing drupal_bootstrap() (such as Secure Site), disable them,
try disabling your PHP cache engines (such as XCache, Zend optimizer) to see if that's the problem,
test it on different environment/machine,
eventually restore your database from the point where it was working before
I'm trying to use the template from http://jenkins-php.org in my installation of Jenkins. As soon as I go in to configure the project I get a grey screen appearing and the words 'Loading'
If I look in the Browser error console I get TypeError: 'undefined' is not an object (evaluating 'registry.get')
Has anyone else experienced this problem? How can this be fixed?
We had this problem when upgraded to 1.528.
Digging further, we found out that the problem is originated from one of the client-side script files called "hudson-behavior.js" and is caused by the "Publish Over SSH" plugin. There have been other plugins that have caused this in the past, as well. We couldn't disable the plugin anyway. So we searched further.
Long story short, we ended up changing the script for the time being. If you, like us, install Jenkins using the war file, then the script file is probably extracted and cached in "/var/cache/jenkins/war/scripts/hudson-behavior.js".
The following change we made was in a function called "registerValidator":
if (depends==null) { // legacy behaviour where checkUrl is a JavaScript
try {
return eval(url); // need access to 'this', so no 'geval'
} catch (e) {
// set depends to an empty array.
depends = [];
}
}
var q = qs(this).addThis();
The URL may not always be valid. Thus, a try-catch is in order. Hope this helps!
I've just had the same issue, I'm using version 1.523 of Jenkins on an Ubuntu server.
The solution I found was to manually edit the project config.xml file.
sudo vim /var/lib/jenkins/jobs/yourProjectName/config.xml
I had images in the description and I removed those leaving the description tag empty.
I also had an empty plot section which I removed completely from the publishers section.
After saving the config and going back to 'manage Jenkins' and then 'Reload Configuration from Disk' I then reopend my project and the config opened normally again.
I wasn't getting quite the same error message as you in the browser console to start with, but I hope that helps.
I too downgraded to 1.523 and then it worked... So it's obviously some bug introduced after 1.524.
Upgrading from 1.530 to 1.531 fixed it for me.