Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I get the next error when trying to use
drush pm-enable views
on a drupal 7.2 core installed with an oracle 10 backend:
Command pm-enable needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to[error]
run this command.
The drush command 'pm-enable views' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This error often occurs when Drush is trying to bootstrap a site that has not been installed or does not have a configured
database.
Drush was attempting to connect to :
Drupal version : 7.2
Site URI : http://default
Database driver : oracle
Database hostname : localhost
Database username : DRUPAL
Database name : XE
Default theme : garland
Administration theme: garland
PHP configuration : /etc/php.ini
Drush version : 4.4
Drush configuration:
Drush alias files :
Drupal root : /opt/workspace/drupal-7.2
Site path : sites/default
Modules path : sites/all/modules
Themes path : sites/all/themes
File directory path: sites/default/files
%paths : Array
You can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command
line or $options['uri'] in your drushrc.php file.
This is the same error i get if i try to use pm-enable on a folder with an unfinished installation of Drupal.
Has drush support been tested?
Is drush able to use the driver?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#45 | drush-pdo_oci-1180240-45.patch | 4.78 KB | hswong3i |
#41 | oracle-1180240-3.patch | 8.12 KB | aaaristo |
#39 | oracle-1180240-3.patch | 7.87 KB | aaaristo |
#36 | drush-oracle-1180240-2.patch | 808 bytes | aaaristo |
#28 | drush-oracle-1180240.patch | 6.33 KB | aaaristo |
Comments
Comment #1
aaaristo CreditAttribution: aaaristo commentedno i think actually it cannot use the driver. It was working with drupal 6.x. I've not looked at it too mutch yet...
Comment #2
sionescu CreditAttribution: sionescu commentedany pointers on where to start looking? i'll try to look into this but i got as far as
drush_get_context_options
- i don't realy know where to go from thereComment #3
aaaristo CreditAttribution: aaaristo commentedmay be you can try asking on the drush project.. i'dont know drush very well, in my experience syslog() and debug_backtrace() functions are really usefull tools to understand how a piece of php code works.
Comment #4
sionescu CreditAttribution: sionescu commentedThanks, i'll move the issue to drush then.
Comment #5
sionescu CreditAttribution: sionescu commentedComment #6
jonhattanLook at drush_valid_db_credentials() in includes/environment.inc
Comment #7
greg.1.anderson CreditAttribution: greg.1.anderson commentedYes; drush supports mysql, pgsql, sqllite, and sql server support is in progress. Oracle is unsupported; some work, including but not limited to #6 would be required to get it to work.
Comment #8
sionescu CreditAttribution: sionescu commentedThis is the patch file that will enable drush to connect with the oracle driver.
It fixes the pdo type ('oci' not 'oracle') and it creates the connection string.
Comment #9
sionescu CreditAttribution: sionescu commentedThe next error i got after doing the patch was:
This was because the null entry into the users table had the id:36 - this is probably because some issues with oracle sequences. I got past that by updating the uid to 0 but this should probably be fixed in the install procedure of drupal.
Comment #10
jonhattan@sionescu we only accept new functionality primarily in the 5.x branch, and after it gets in it may be backported to 4.x. Also see this issues for reference: #1050030: sqlsrv PDO driver uses invalid connection string
ps. you need to set "needs review" when you post a patch.
Comment #11
greg.1.anderson CreditAttribution: greg.1.anderson commentedI don't know what to say about #9, but the code in #8 looks good in concept. It needs to be rolled against the master branch (drush-5.x), and should support both Drupal-6.x and Drupal-7.x prior to commit. This won't get you sql-dump et. al., but we could start here.
Comment #12
greg.1.anderson CreditAttribution: greg.1.anderson commentedComment #13
sionescu CreditAttribution: sionescu commentedI checked against 5.x-dev and there seem to be no issues in the environment.inc file but this will need to be properly reviewed.
Thank you!
Comment #14
sionescu CreditAttribution: sionescu commentedComment #15
greg.1.anderson CreditAttribution: greg.1.anderson commented@sionescu: Maintainers are a lazy bunch; when we see something like
Hunk #1 FAILED at 1215.
from the patch command, we usually want the original submitter to reroll (recreate) the patch so that it applies to the most recent version without errors. Your patch does not apply to the head of the 7.x-4.x or the master branch, or even to the 7.x-4.4 branch. Please submit a new patch against master.Comment #16
sionescu CreditAttribution: sionescu commentedThe patch was created from two local files. I didn't work with git before, so could the issue be that the patch was not created against a drush repo?
Comment #17
sionescu CreditAttribution: sionescu commentedThis is the patch against master. Thanks.
Comment #18
jonhattan@sionescu please see issue #1050030: sqlsrv PDO driver uses invalid connection string where support for other database (sqlsrv) was implemented. There're other places of drush where code is needed to fulfill oracle support.
Also, review your code to not include trailing whitespaces.
Comment #19
sionescu CreditAttribution: sionescu commented@jonhattan thanks for the info, i will probably be able to address those other issues as i run into them so i'm not making a commitment on following this to the end. My goal was to have pm-enable pm-disable working at this point.
i will remove trailing white spaces from future patches.
thanks.
Comment #20
chrisschaub CreditAttribution: chrisschaub commentedI've created a new patch that builds on the work in comments/patches #17 and #18. I tried to incorporate the method used to bring in sqlsrv support as much as possible. The following drush commands work for me with Oracle 11.2 :
drush sql-query (with special help for describe and show tables queries)
drush sql-cli
drush status
drush pm ... (enable modules etc)
drush ws (watchdog stuff)
Many of the other features work as well. I've also put some time into best guess formatting for output from sqlq queries.
I didn't get sql-dump or sql-drop working, mostly due to the complexities of Oracle's constraints -- and that it would have to integrate the exp and imp utilities. I'll try to add those in a bit, I have my own scripts to do those functions that could probably be worked into drush. I haven't tested the sync stuff yet either and am sure it won't work because table dropping is not implemented.
I haven't tested Drupal 7 yet, and I'm sure work will need to be done there. I've also added support for rlwrap which gives readline support if you have rlwrap installed (unix only, sorry).
This patch is against the latest 5.x master. Use at your own risk, I'm posting this just to keep the development going, not ready for production sytems! Hope it moves us further along.
Comment #21
chrisschaub CreditAttribution: chrisschaub commentedSetting status to Needs Review for patch in comment #20.
Comment #22
moshe weitzman CreditAttribution: moshe weitzman commentedelse must use 2 lines per drupal coding standards.
comment does not match code?
leading space
oracle cares about file extension?????
Comment #23
chrisschaub CreditAttribution: chrisschaub commentedI'll re-roll patch #20 with those corretions, thanks Moshe. But yes, oracle does care about scripts ending in .sql. You can set the extension, but I could not find a way to say "no extension" -- it has to be something. That comment was repeated throughout for the other cases, I'll just edit it.
Comment #24
chrisschaub CreditAttribution: chrisschaub commentedI've re-rolled this patch against the latest "master". I think the issues are fixed from #22. I cannot find a way to get around the file extension issue with oracle, I think it's a legacy thing.
Comment #25
greg.1.anderson CreditAttribution: greg.1.anderson commentedSorry I didn't review the earlier patches sooner, but I just took a look at #24 and came up with a necessary change:
I don't like using the DRUSH_DB_CREDENTIALS context to alter the behavior of drush_tempnam. This code could cause an undesirable side-effect in callers that are using drush_tempnam for purposes other than an sql import. While there is no operational problem with a spurious ".sql" on the end of a temp file, it could be confusing to see it there. I also would not want to see this coding style spread to other parts of the code where the impact might be greater.
Instead, the function prototype of drush_tempnam should be altered:
function drush_tempnam($pattern, $tmp_dir = NULL, $extension = '')
Insure that any code path that calls drush_tempnam from a context where it will end up being used with Oracle passes '.sql' for $extension.
Comment #26
chrisschaub CreditAttribution: chrisschaub commentedDo you want me to resubmit a patch for drush that changes the prototype for drush_tempnam? I don't want to overstep.
Comment #27
greg.1.anderson CreditAttribution: greg.1.anderson commentedYes. If you provide a default parameter as shown above, you will not break existing code. I think that the enhancement is generally useful.
Comment #28
aaaristo CreditAttribution: aaaristo commentedrefactored cschaub patch... probably we don't need to change drush_tempnam.
tested against the master branch
Thanks cschaub!
Comment #29
moshe weitzman CreditAttribution: moshe weitzman commentedLooks good to me. Lets wait a couple days for feedback.
Comment #30
chrisschaub CreditAttribution: chrisschaub commentedI'll test it out, thanks! I was not able to find time to rewrite the tempnam stuff.
Comment #31
jonhattanre #20 if sql-dump and sql-drop are not supported, the user should be informed. At execution time better than in the help.
Comment #32
aaaristo CreditAttribution: aaaristo commentedstarting from my patch sql-dump and sql-drop are supported
Comment #33
moshe weitzman CreditAttribution: moshe weitzman commentedI made the tempnam changes and committed this.
Comment #34
moshe weitzman CreditAttribution: moshe weitzman commentedComment #36
aaaristo CreditAttribution: aaaristo commentedCannot bootstrap oracle in Drupal 6, moved PDO driver name translation only for drupal >=7
Comment #37
moshe weitzman CreditAttribution: moshe weitzman commentedcommitted
Comment #39
aaaristo CreditAttribution: aaaristo commentedAdded sql-sync support for oracle
Comment #40
greg.1.anderson CreditAttribution: greg.1.anderson commentedLooks pretty good. Note that $create_db_file is not cleaned up on the remote machine, in cases where the target is remote; it is only cleaned up on the source machine. Temp files should be cleaned up in all locations where they are written.
Comment #41
aaaristo CreditAttribution: aaaristo commentedfixed it
Comment #42
moshe weitzman CreditAttribution: moshe weitzman commentedThe table creation code is so verbose!
I have been OK with the messiness for a while but it would be really nice if we could move DB suport engine system and let oracle/sqlserver live in Contrib. I guess thats a future patch.
Also, it would be nice if someone ran the test suite with sqlserv and/or oracle and fixed any failures. At one point, the suite passed with pgsql and mysql so it can be done.
Would be ideal if someone could verify that this patch works.
Comment #43
chrisschaub CreditAttribution: chrisschaub commentedI'm seeing some strange behaviour enabling modules. With my patch, modules enable correctly, and they do from the web interface as well. When I enable them with this latest version, the wrong modules get enabled! Devel gets enabled, openid, etc ... and I'm just enabling webfm or a custom feature. I think there is something amiss.
Comment #44
moshe weitzman CreditAttribution: moshe weitzman commentedComment #45
hswong3i CreditAttribution: hswong3i commentedDuring development a new version of pdo_oci driver (http://drupal.org/project/pdo_oci), I found that Drupal installation works but drush fail. It is because:
$creds['database']
but not$creds['name']
charset=AL32UTF8
will no long works with php-5.4A quick fix attached with a bit coding style clean, too.
Also fork to github as https://github.com/pantarei/drupal-drush/tree/7.x-5.x-1180240
Comment #46
supermp CreditAttribution: supermp commentedI'm very interested in seeing Drush fully support Oracle, When can we expect these fixes to be merged back into the main branch?
Comment #47
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis issue was marked
closed (won't fix)
because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate)
.Please ask support questions on Drupal Answers.