I have set up a little server on an old XP Pro box, with php 5.3.1.
In order to use it as a test box to mirror our hosted site, I need to get sqlite sessions working.
While sqlite is definitely there in phpinfo(), I can't seem to get php.ini to use it as a save handler:
Registered save handlers - files user
In php.ini, I've got
session.save_handler = sqlite
session.save_path = "D:\temp\php-session"
A good question to have answered first is, does the SQLite plugin you're using expose itself as sqlite or sqlite3?
You may try using sqlite3 as your session.save_handler value. Make sure you start your sessions, too!
if you want to use SQLite as a session handler, two options :
It's registered as a session handler (you can check this in the phpinfo() > Registered save handlers). Usually it's "User, files" which means that you can't use SQLite as a session handler directly.
You can write your own session handler by implementing session_ set_save _handler(). An example is given in the manual.
The problem turned out to be the system variable PHPRC not being read for some reason. My php.ini was being ignored.
Found this out by going thru and redoing EVERYTHING over again to make sure I hadn't misconfigured something somewhere. I didn't see any difference between the old and new var, but after a reboot things were suddenly coming up roses.
Thanks to everyone who offered suggestions!
Related
I've been testing stuff out with Superset and I think I corrupted my superset db. When I try to acess any chart i get this error:
I found a workaround to this problem, by searching with ag - the silver searcher which individual migration dropped the dbs.perm table, and using the command
superset db downgrade <migration-id>
on the migration prior to that one.
It's still not very clear to me which steps I would take as to completely reset the db safely.
I have the manual, dev installation since I'm working on customizing the code. Let's say I didn't have anything too important in the db, so I'm not afraid to loose tables, users, perms, etc.
I've found I have a superset.db in ~/.superset, but I don't think deleting that will be enough, right?
How can I reset Superset's db so as to make a clean db and start over? Can I do this without losing my Superset installation, or do I need to start over completely? In any case, can you guide me through it?
You need not to reinstall everything. Just remove the ~/.superset/superset.db file and take the backup of this file before removing it just in case you want to restore it. and then run the below commands. These commands will create another database file.
Initialize the database
superset db upgrade
Create an admin user (you will be prompted to set a username, and first and last name before setting a password)
$ export FLASK_APP=superset
$ superset fab create-admin
Load some data to play with
superset load_examples
Create default roles and permissions
superset init
deleting superset.db in ~/.superset should be enough and it's the more clean way to start over. Yet note that SQLLite is not a recommended DB engine for metadata and it's support should be completely removed on the future.
I also recommend using the docker-compose provided for testing/developing on Apache Superset
I have a legacy ASP application that I support. By support I mean that I haven't touched it since about 2005 because its just worked.
However there were a couple of data issues in the Access database that the ASP application uses. So like a fool I opened the database directly over a fileshare (using MS Access 2007), fixed the data and saved it down (in Access 2000 format).
Now the application will retrieve and display the data OK, but any updates fail with the error 3705: Operation is not allowed when the object is open. I have not changed the code in any way, the only change was the data update and database save.
I've found plenty of examples of this error, but they all relate to fairly simple issues like ensuring the recordset is closed before opening it, changing the CursorLocation enum, etc. I've tried most of these in the vain hope that something will work, but nothing has.
Any ideas how can I fix this?
Thanks.
UPDATE
I've installed a web based access database management system, and have tried to compact and repair the database. I received the error:
The Microsoft Jet database engine cannot open the file '<snip>'. It is
already opened exclusively by another user, or you need permission to view
its data. (-2147217911)
I have run the macro detailed here to determine who is logged onto the database, and just showed the admin user (which was me - while running it)
Those errors mean one thing: the database file is opened by some other process and thus is being locked.
Most likely that "web based access database management system" is the culprit, try to find how you can configure it to not lock the file, or get rid of it.
As a work around or way to verify the real problem, you can copy the .mdb file into different location and change the classic ASP connection string to check if you can update the database in its new location.
#Remou's comment above about checking the file and folder permissions was correct.
I had our server admin check the permissions, and it seems that the write access had dropped off the folder (and the files also inherit their permissions from the folder). He said that this has happened before when saving directly over the fileshare.
(accepting in lieu of an answer from #Remou)
I am publishing an AIR app in debug mode using FlashDevelop and have included a database in the files/folders to be published.
When the app first launches it checks whether there is an instance of this db in the applicationStorageDirectory, if there isn't it copies the included one from the applicationDirectory to the applicationStorageDirectory.
This should mean that the referenced database dbFile = File.applicationStorageDirectory.resolvePath(DB_FILE_NAME); should now be writable, however when i run the app i can read the records from the table but when i attempt to write using an SQL statement I get an SQLError: 'Error #3122: Attempt to write a readonly database'.
I know that this would be thrown if i was attempting to write to the read only location of the applicationDirectory but i'm certainly using the File.applicationStorageDirectory location which should (as far as i know) be writable.
The location of the db on my Windows 7, 64bit = C:\Users\sean.duffy\AppData\Roaming\FishFightAppData\Local Store\db this is found using the dbFile.nativePath property so again i'm sure i should be able to update the db.
Anyone got any ideas? I have tried everything i could think of and searched all over but the only common cause seems to be when people try to write to the asplicationDirectory and not the storage directory....
UPDATE::
My bad - have just realised that i've misread the API of the 3rd party library i'm using! I should have been calling executeModify(statement) which can modify the contents of the db, instead i'm calling execute(statement) which doesn't/can't overwrite the db.
The source code is compiled into a swc and there was no documentation to point out you needed to use executeModify, although i should have guessed from the name i suppose!
Sorry about that and thanks for your help
(As a public courtesy to get this off the unanswered list, I am reposting the apparent solution. As usual, the asker is more than welcome to ignore mine and post it themselves and accept their own answer.)
In this API, you need to call executeModify(statement), not execute(statement). The latter does not overwrite the database.
Everything I have read so far, it seems as though you copy the DB from assets to a "working directory" before it is used. If I have an existing SQLite DB I put it in assets. Then I have to copy it before it is used.
Does anyone know why this is the case?
I can see a possible application to that, where one doesn't want to accidentally corrupt database during write. But in that case, one would have to move database back when it's done working on it, otherwise, next time program is run will start from "default" database state.
That might be another use case - you might always want to start program execution with known data state. Previous state might be set from external application.
Thanks everyone for your ideas.
I think what I might have figured out is that the install cannot put a DB directly to the /data directory.
In Eclipse there is no /data which is where most of the discussions I have read say to put it.
This is one of the several I found:
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/comment-page-4/#comment-37008
I'm being asked to look into a problem that occurs intermittently on a WebServer running my team's application.
Essentially, we have a webservice that does a lookup between codes. If you have Code Type A, you can use it to look up the corresponding Code Type B. Periodically, when memory is running low, when this webservice is called, a null reference exception is being thrown. Essentially, this service loads a lookup file into cache with a dependency on the file, so if the file chages, the cache is reloaded with the new file. The priority on the cache object is set to default. I'm guessing that somewhere in the code, it isn't being verified that the cache object is still there and when memory on the server gets low, that object is dumped causing the error. I'd like to be able to recreate the error and verify before I start digging into this code.
Is there a way in IIS manager (or from the command prompt) to force a running web app to dump it's cache? I would think that this should recreate the condition and therefore recreate the bug. Not to mention, seeing the detail error should lead to the right section of code.
Thanks,
Steve Brouillard
My gut reaction would be to set the WebMethod's CacheDuration to zero, then back to whatever you want on an ongoing basis. I haven't tried this, but I think this would dump the cache then start it forming again...
I found a utility that can be added to ASP.NET apps that will allow you to dynamically manage the cache as a whole or individual cache objects. Thanks to .NET Rocks! and dnrtv.
Here's a link to the tool that I used. This allowed me to clear just the specific objects in question, on the fly, and prove the error.
Thanks to everyone for your help. ASP Alliance Cache Manager.
Steve