Problem with Database connection in laravel 7 - database

I am using Laravel 7 and I am also new to Laravel.
I'm trying to create a user Authentication after installing the following :
composer require laravel/ui
php artisan ui vue --auth
php artisan migrate
I tried registering by going http://127.0.0.1:8000/register but anytime I clicked Register it was telling me "that Illuminate\Database\QueryException
SQLSTATE[HY000] [1049] Unknown database 'laravel' (SQL: select count(*) as aggregate from users where email = olaoyesunday#yahoo.com)"
but I changed DB_DATABASE=ecomm3laravel in .env file.
I wouldn't know the reason why is still seeing Laravel in my DB-DATABASE instead of ecomm3laravel. Please, help me out.

Related

Use private repository from Gitlab 404 error

We want to use the private repository function from Gitlab. For that we created a group and in that group we want to create several projects. I'm able to build versions and packages and publish them using semantic-version. I can see that the packages are visible at the 'Package Registry' page.
But I have trouble installing those packages in other projects using npm install. I only gets a 404 error when I run the install command. I tried several things which I can find in the gitlab docs.
This is how the structure in my account looks like:
root
company (group)
license (project)
auth (project)
The packages are called #company/license en #company/auth, according to the gitlab guidelines.
I want to be able to install all the packages and the future ones, so using the 'instance-level' should be the solution here (altough 'project level' isn't working either).
So, I added
#company:registry=https://gitlab.com/api/v4/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=(personal access token)
to my .npmrc. We are not using our own instance at gitlab.
But when try to run npm install #company/license I get Not Found - GET https://gitlab.com/api/v4/packages/#company%2flicense. That is the same error which I get when I sent a GET request to that endpoint in Postman with my token as Bearer Auth.
This error also occurs when I set the project level url (https://gitlab.com/api/v4/projects/(project id)/packages/npm) in my .npmrc file.
I have tried to using a group url (https://gitlab.com/api/v4/groups/(group id)/packages/) which gives me the packages (in my browser and in postman) but when setting this URL as registry I get the same error.
NPM adds the package name in the URL and that gives indeed a 404.
What I'm doing wrong? I've seen a lot of people have this work, so it must be a stupid thing which I can't see.
I found out that my scope was not correct. I was thinking that the scope was based on the folder where the projects where located,but the scope needs to be the same as your username.
So in my case the scope needs to be #root/license. Where root is of course something like 'company name inc.', so scope will be #company-name-inc. It's the same name which you can see in the URL as first 'page' when you are opening a project or group: https://gitlab.com/company-name-inc/group-name/project-name
In my .npmrc file I can now just add the instance based entrypoint and that will work!
#company-name-inc:registry=https://gitlab.com/api/v4/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=[deploy token]

Pantheon Drupal 7 setup issue with clean url

On my site under admin section node view (node/xxx) is working fine but when I am trying to edit a node (node/xxx/edit) give me following error
ERR_TOO_MANY_REDIRECTS
This issue is only on Pantheon when I do it on my local server it is working fine.
I already checked .htaccess and web.config file. The same configuration is working for me with another setup
Finally i got solution. Actually i installed ThemeKey module and the ThemeKey Debug creating redirection issue on Pantheon only i disabled it and site is working.

Problems with django app DATABASES setting for heroku deployment

When I change my setting of Database according to the official guide as
DATABASES['default'] = dj_database_url.config()
It has
NameError: name 'DATABASES' is not defined
when building.
When I change the syntax of database settings to
DATABASES = {
'default': dj_database_url.config()
},
it has
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details. when opening the app locally.
and it has
Internal Server Error: The server encountered an unexpected internal server error (generated by waitress)
when launching from heroku.
Notice, this way worked once. But when i merge my code with my friends, it has problem again. I roughly located it was database problem. So i delete the database on heroku and wanted to sync again. But when I sync the database, it has Import error: No module named events.
When I change the setting back to the original way:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_PATH, 'db.sqlite3'),
}
}
It can work locally(of course), but can't in the heroku, with the error of Import error: No module named events too when syncing the database.
PS:
1, I made sure that Heroku installed all the requirements I need to run the app, especially i triple checked all the files: models, views, urls, etc.
2, I use waitress as the server instead of gunicorn recommended by the Heroku official guide.
How can I fix it?
You need a DATABASE_URL environment variable that dj_database_url will read.
To set it, run heroku config: set DATABASE_URL=<your database url> from your terminal.

JHipster Atmosphere websocket does not connect

With a newly scaffolded app generated from "yo jhipster" and started with "mvn spring-boot:run" and "grunt server" I am able to load the app and do operations like login, view metrics, see sessions, settings, logs, and audits. However, whenever I view the "User Tracker" page I don't see anything?
I believe this section is supposed to demonstrate Atmosphere websocket / AngularJS integration? Looking at the browser console logs, I see the following:
Websocket failed. Downgrading to Comet and resending atmosphere.js:2866
GET http://0.0.0.0:9000/websocket/activity?X-Atmosphere-tracking-id=0&X-Atmosph…true&X-Cache-Date=0application%2Fjson&X-atmo-protocol=true&_=1393276976964 404 (Not Found)
It appears that a websocket connection is attempted but eventually times out and the fallback long polling doesn't work? I'm using the latest Chrome (also tried on latest versions of Firefox and Safari as well).
Am I missing something simple?
-- Update 1 --
Deploying it as a WAR to Tomcat 7.0.50 shows data back from Atmosphere in the User Tracker page but it continuously loops trying to get a WebSocket connection (HTTP status code 101: switching protocols) so the user data appears and disappears periodically. I saw an error in Chrome like this:
No suspended connection available. Make sure atmosphere.subscribe has been called and request.onOpen invoked before invoking this method
The Tomcat logs show the following:
[WARN] org.atmosphere.cpr.DefaultAnnotationProcessor - Unable to detect annotations. Application may fail to deploy.
-- Update 2 --
Deploying it as a WAR to Jetty 8.1.14.v20131031 (Jetty 9.1.1.v20140108 throws errors) and testing it with Chrome 32.0.1700.107 appears to work for the fallback transport of long-polling. The initial connection to WebSockets, however, fails because Atmosphere for some reason thinks the servlet container is Tomcat? In the server logs, it throws the following issue:
java.lang.ClassCastException: org.eclipse.jetty.server.Request cannot be cast to org.apache.catalina.connector.RequestFacade
at org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:141)
at org.atmosphere.container.Tomcat7Servlet30SupportWithWebSocket.service(Tomcat7Servlet30SupportWithWebSocket.java:62)
Thanks again for all your help -- definitely making progress :)
-- Update 3 --
To summarize everything:
Currently "mvn spring-boot:run" and "grunt server" don't work together for Websockets or long-polling
If you deploy the JHipster WAR (mvn package) to Jetty 8.1.14.v20131031 then it works but you need to remove the following dependency from your JHipster pom.xml or else Atmosphere will not provide WebSocket support:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
Argh. False alarm -- I had it running using streaming, not websockets, so WebSockets still has the error from update2
No you're not missing anything :-)
If you use the Java server directly it should work: you need to connect to the application with another browser (or another tab) and you will see working.
However, with "grunt server", there is a bug: the Grunt proxy just does not support Websocket, so it doesn't work... There is one strange thing, thus, it's that the fallback transport does not work.
I'm filling this as a bug.
-- update 1 --
Concerning your update, it looks there's another Atmosphere bug:
http://atmosphere-framework.2306103.n4.nabble.com/Log-warning-that-Atmosphere-is-unable-to-detect-annotations-td4658159.html
It seems that Atmopshere can't find its annotation inside a WAR, can you try the same thing in development mode ("mvn spring-boot:run")? That would means it's an issue with WARs in Tomcat

Laravel: view not found

I'm developing an internal site using Laravel 4, I have everyone working on my laptop (Windows & Apache).
I've now moved the site to a Turnkey Linux 13 VM for beta testing and have encountered the following problem:
The home page loads fine.
When I come to load the About page (or any other page) I get "requested URL /internal/about not found".
The Laravel config is exactly the same.
Apache's document root is set to: /var/laravel/public.
Apache gives the following error in the logs:
"File does not exist: /var/laravel/public/internal"
Yet the Laravel config is specifying the default view directory and the home page loads fine.
It was an Apache config issue, mod_rewrite wasn't enabled (it was on my Windows laptop), simply enabling this resolved the issue.

Resources