I try to run serverless offline with NestJS + Typeorm. First time I call to get all users, it worked. But second time, I got an error:
ERROR [ExceptionHandler] No repository for "User" was found. Looks like this entity is not registered in current "default" connection?
I added keepConnectionAlive: true but it doesn't work. Please help me, thank you!
Try --allowCache option.
I'd got exactly same issue with you
This command worked for me.
npx sls offline --allowCache start
Related
I'm running into this issue when deploying my django app on heroku. It had be building and deploying fine before I edited my django model to include a geometry field:
geom = models.PointField(verbose_name='geo',srid = 4326)
Now it builds successfully, but then fails at this migration code in the Procfile
`release: python manage.py migrate`
The migration file is successfully in my git repo. And locally I was able to run python manage.py migrate successfully. When I go to migrate on heroku I get the below error.
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'
It seems to indicate that there is something "geo-related" missing, but I can't figure out what since I have created a postgis extension on the postgres db in heroku and I have the heroku-geo-buildpack along with the heroku/python buildpack.
On heroku I have python 3.10 and locally it's Python 3.9.13.
In my settings.py file I have:
'ENGINE':'django.contrib.gis.db.backends.postgis', in the DATABASES
and 'django.contrib.gis', in INSTALLED_APPS
Here's the post-gis extension on the heroku postgres database:
And the two buildpacks set in heroku:
Thank you for any help or guidance!
Okay - turns out I had an important couple of lines commented out in my settings.py file. Posting the answer here in case it helps anyone! From my understanding, this part helps make sure the postgis engine is used on the heroku server. But please if anyone knows more about why this helped fix my issue, comment and post, I'm all ears! Thanks!
import dj_database_url
DATABASES['default'] = dj_database_url.config()
DATABASES['default']['ENGINE'] =
'django.contrib.gis.db.backends.postgis'
DATABASES['default']['NAME'] = os.environ['NAME']
I am having issue connecting my dbt cloud and dbt core to databricks
I have read these 4 links, but still can not connect
https://docs.databricks.com/integrations/prep/dbt-cloud.html#connect-to-dbt-cloud&language-Cluster
https://docs.databricks.com/integrations/prep/dbt.html
https://docs.getdbt.com/reference/warehouse-profiles/databricks-profile
https://github.com/databricks/dbt-databricks
on dbt-cloud:
When I test the connection during the project creation step, it passed the test. however when I use the connection to create a job and run, it returns this message:"Cannot set database in spark!"
Edit: the issue once has been fixed but it comes back again.
original fix:
The dbt-core connection issue has been fixed. The issue is caused by the python certificate issue on MacOS. please refer to this link for the solution
on dbt-core:
this how I set up my profiles.yaml file base on the documentations:
databrick_dbt_lakehouse:
outputs:
dev:
host: adb-755xxxxxxx7.7.azuredatabricks.net
http_path: /sql/protocolv1/o/755xxxx7/0517-xxxxxx-xxxxxx
schema: default
threads: 1
token: dapi<my token>
type: databricks
target: dev
Note:
for http_path i have tried both with or without backslash (/) before sql/...
I assume the schema means database name. I have tried 2, but none of them works
I use pipenv with python version 3.8.8
when I run dbt debug I got this message:
check failed:
dbt was unable to connect to the specified database.
The database returned the following error:
Runtime Error
Database Error
failed to connect
Please help, thanks
Your http_path seems wrong. Here is an extract from my profiles.yml
databricks_dbt_demo:
outputs:
dev:
host: adb-redacted.azuredatabricks.net
http_path: /sql/1.0/endpoints/redacted # for SQL Endpoint
# http_path: /sql/protocolv1/o/{ORG-ID}/{CLUSTER-ID} # for All-Purpose Cluster
schema: your_database_here
token: your_personal_access_token_here
type: databricks
target: dev
Are you using a cluster (e.g. All Purpose Cluster) or a SQL Endpoint?
Edit: This issue is came back again. I am writing this comment on the 3rd day after the original fix
When I run dbt run or dbt snapshot the returns this error message:
Encountered an error:
Runtime Error
Database Error
failed to connect
original fix:
The issue is caused by the python certificate issue on MacOS. please refer to this link for the solution.
The dbt cloud issue is caused by the incorrect schema name in the yaml file
I'm developing web application using node js and mongo db. Initially I got this error - failed to connect to [localhost:27017]. I followed the steps in this answer [Link: https://stackoverflow.com/a/39276869/7697507]. But, after doing the 3rd step, I am getting this error.
Can anyone please let me know how to solve it?
Windows doesn't allow spaces in paths like this.
Try:
mongod --dbpath "C:\Users\dell pc\Desktop\Real Safe\final\data"
With the path in quotes.
I'm trying to test a node.js module using Travis, but all I get is "Redis connection to localhost:6379 failed - connect ECONNREFUSED".
Can someone please tell me what am I doing wrong? The latest build is at: https://travis-ci.org/luiselizondo/config-persistence/builds/65187913
Thanks
I had a look at your problem and it seems the problem is due to the format of your .travis.yml file.
I forked your project and removed the leading spaces in front of the language and node_js fields. I have created a pull request here that shows the changes I made.
You can see the result of my build here.
Hope this helps!
I'm using the Nodejitsu and their packaged Mongolab MongoDB database. I ran the command jitsu databases get myDB and I got instructions on how to connect via mongo CLI. The out put of that command has a line that says the following:
help: Connect with the `mongo` cli client:
help:
$ mongo ds039267.mongolab.com:39267/nodejitsu_xxxxxx_nodejitsudb8577296358 -u nodejitsu_xxxxxx -p mypassword
NOTE: This is the first time I am connecting to this instance via the CLI. I only created the database name through jitsu databases create…
I am using Mongo Shell version 1.8.3. I connected to my instance of MongoDB. I tried running the command: show dbs and I got:
uncaught exception: listDatabases failed:{ "ok" : 0, "errmsg" : "unauthorized" }
I am using Mongoose and I have a model called Post. I tried to run: db.post.find() in the CLI, I got:
error: { "$err" : "not authorized for query on hotel.post", "code" : 16550 }
What does this mean? Am I not authorized; I thought I connected successfully?
Updated
I upgraded my mongo shell to the latest, 2.4.x version and still I'm getting this problem. Anyone have any experience with nodejitsu & mongolab?
MongoLab creates databases that require an authenticated user to access. When you connect with the Shell, you will need to provide the UserName and Password to the shell command. Docs are here.
mongo --username Mark --password something
You will need that Username/Password combination to be configured within mongoose as well. The Mongoose docs have details on the possible ways to do this.
Note that you are using a very old shell. 1.8.3 is about 4 versions back from the current 2.4.* line. This is not directly related to your problem, but it's definitely something you should rectify going forward.
Inside the mongo shell try to authenticate once again:
db.auth('yourUsername','yourPassword');
One possible error could be like me : Using special chars in the password breaks the URI!
The generated password was
X/apm~nq5JaJ,5
So OBVIOUSLY, the / broke the request and I got :
MongoError: not authorized for query on apm~nq5JaJ.system.indexes
You can try to include at the end of your URI: ?authMode=scram-sha1