Kali linux installation fails. I think it could be some driver problem, what can I do?

I have some problems installing kali linux, as the installation finish (seems so), it goes black screen, only thing i can see is the pointer and once a while something like a white flash on the screen, then black again…

Can it be some sort of driver problem (i have a geforce 1050ti)? What can i do?

I use balenaetcher to put my iso in a pen drive(8 gb) and I also have a 32gb partition.

php – Laravel 8: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

I want to apply OneToMany Relationship between users and roles table and I have already some data in these two tables.

So in order to make this relationship, I made this Migration for adding role_id to users table:

public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->unsignedBigInteger('role_id')->nullable()->unsigned();
            $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
        });
    }

But when I want to run this Migration, I get this error:

SQLSTATE(42S21): Column already exists: 1060 Duplicate column name
‘role_id’ (SQL: alter table users add role_id bigint unsigned
null)

So what is going wrong here ? How can I fix this issue ?

Here is also the Migration of roles table:

public function up()
    {
        Schema::create('roles', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('slug');
            $table->timestamps();
        });
    }

java – Maven project using EclipseLink for persistence runs on IDE, but fails when running from a built jar

I’m working on a maven project using eclipselink 2.7.8 for persistence. When I run it on my IDE (Netbeans 12.0) it works perfectly well, but when I attempt to run it from a built jar it doesn’t.

This is the stack trace when I use the jar

Exception in thread "main" Local Exception Stack:
Exception (EclipseLink-30005) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: jdk.internal.loader.ClassLoaders$AppClassLoader@2cdf8d8a
Internal Exception: javax.persistence.PersistenceException: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:129)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:118)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:191)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
        ...
Caused by: javax.persistence.PersistenceException: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2109)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2085)
        at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:104)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:107)
        ... 15 more
Caused by: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:233)
        ... 19 more
Caused by: java.lang.NullPointerException
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.hasEntity(MetadataProject.java:1441)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.isOneToMany(MetadataAnnotatedElement.java:693)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.buildAccessor(ClassAccessor.java:609)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.addAccessorFields(ClassAccessor.java:438)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.addAccessors(ClassAccessor.java:410)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.preProcess(ClassAccessor.java:1225)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EmbeddableAccessor.preProcess(EmbeddableAccessor.java:304)
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1851)
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:579)
        at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:629)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2006)
        ... 17 more

My persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
      <persistence-unit name="MyPersistenceUnit" transaction-type="RESOURCE_LOCAL">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        ...
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
            <property name="javax.persistence.jdbc.url" value="jdbc:h2:./bd/MyPersistenceUnit"/>
            <property name="javax.persistence.jdbc.user" value=""/>
            <property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
            <property name="javax.persistence.jdbc.password" value=""/>
            <property name="javax.persistence.schema-generation.database.action" value="create"/>
        </properties>
    </persistence-unit>
</persistence>

My pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    
    <modelVersion>4.0.0</modelVersion>
    <groupId>xxxx.xxxxx</groupId>
    <artifactId>Service</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    
    <properties>      
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.7.8</version>
        </dependency>
        
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.194</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>          
            <groupId>org.fusesource.jansi</groupId>
            <artifactId>jansi</artifactId>
            <version>2.3.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
            <type>jar</type>
        </dependency>        
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>example</id>
                        <configuration>
                            <archive>
                                <manifest>
                                    <mainClass>xxxx.xxxxx.service.demonstration.MainDemo</mainClass>
                                </manifest>
                            </archive>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                            <appendAssemblyId>false</appendAssemblyId>
                        </configuration>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>

I suspect that it’s something to do with how maven is building the jar, since it works fine on the IDE. I have tried to utilize different eclipselink versions too, but that didn’t seem to help (I started this project using 2.5.2 but updated after I had problems due to incompatibilities with some Java 8 features)

mariadb – CREATE USER fails when

I’m trying to replicate the SQL required to create a user with privileges, if I use HeidiSQL GUI interface to create a USER and set the privileges it works, then I delete the user from the User manager in HeidiSQL and copy SQL from echoed response area at the bottom of HeidiSQL:

CREATE USER 'simon'@'localhost' IDENTIFIED BY 'password';

Just the above, nothing more, but it fails with a dialog containing:

SQL Error (1396): Operation CREATE USER failed for 'simon'@'localhost'

SQL Server UPDATE Command Fails without error

Using SSMS running the below UPDATE command I get returned message says 1 row affected. but if I then follow it up with a Select and it shows that the row never updated.

This issue happens in SSMS and a custom application I built in C# using Entity Framework. I have since stopped using Entity Framework generated code and moved straight to a stored proc. All of 3 different ways of performing the same task I randomly get this issue. Sometimes it can be 100’s or 1000’s of updates before the issue happens again or it could be a few updates later it happens again.
I have run UPDATE STATISTICS, I have Rebuilt Indexes and Reorganized Indexes.

As a side note, I NEVER have an issue with INSERTs only UPDATEs we never DELETE any records. and total record count on the table is 201,741

UPDATE CreativeWorkFlowQueue
    SET CurrentIndicator = 'N'
WHERE CreativeWorkFlowQueueId = 198231

SELECT *
FROM CreativeWorkFlowQueue
WHERE CreativeWorkFlowQueueId = 198231

enter image description here

here is the table

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE (dbo).(CreativeWorkFlowQueue)(
    (CreativeWorkFlowQueueId) (int) IDENTITY(1,1) NOT NULL,
    (DigitalCampaignCreativeId) (int) NOT NULL,
    (WorkFlowQueueId) (int) NOT NULL,
    (CurrentIndicator) (char)(1) NOT NULL,
    (CreateDate) (datetime) NOT NULL,
    (LastUpdatedDate) (datetime) NOT NULL,
    (IsDeleted) (bit) NOT NULL,
PRIMARY KEY CLUSTERED 
(
    (CreativeWorkFlowQueueId) ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON (PRIMARY)
) ON (PRIMARY)
GO

ALTER TABLE (dbo).(CreativeWorkFlowQueue) ADD  CONSTRAINT (CreateDate defaults to utcDate on CreativeWorkFlowQueue)  DEFAULT (getutcdate()) FOR (CreateDate)
GO

ALTER TABLE (dbo).(CreativeWorkFlowQueue) ADD  CONSTRAINT (LastUpdatedDate defaults to utcDate on CreativeWorkFlowQueue)  DEFAULT (getutcdate()) FOR (LastUpdatedDate)
GO

ALTER TABLE (dbo).(CreativeWorkFlowQueue) ADD  CONSTRAINT (DF_CreativeWorkFlowQueue_IsDeleted)  DEFAULT ((0)) FOR (IsDeleted)
GO

ALTER TABLE (dbo).(CreativeWorkFlowQueue)  WITH CHECK ADD  CONSTRAINT (CreativeWorkFlowQueue DigitalCampaignCreativeId fk) FOREIGN KEY((DigitalCampaignCreativeId))
REFERENCES (dbo).(DigitalCampaignCreative) ((DigitalCampaignCreativeId))
GO

ALTER TABLE (dbo).(CreativeWorkFlowQueue) CHECK CONSTRAINT (CreativeWorkFlowQueue DigitalCampaignCreativeId fk)
GO

ALTER TABLE (dbo).(CreativeWorkFlowQueue)  WITH CHECK ADD  CONSTRAINT (CreativeWorkFlowQueue WorkFlowQueueId fk) FOREIGN KEY((WorkFlowQueueId))
REFERENCES (dbo).(WorkFlowQueue) ((WorkFlowQueueId))
GO

ALTER TABLE (dbo).(CreativeWorkFlowQueue) CHECK CONSTRAINT (CreativeWorkFlowQueue WorkFlowQueueId fk)
GO

EDIT Adding the Stored Proc that also has the same issue.

I did not include this stored proc simply due to the fact that it is complex and if a simple update doesn’t work I figured start there first.

CREATE PROCEDURE (dbo).(sp_WtvToRtl) 
    -- Add the parameters for the stored procedure here
    @tbl DCCIdList READONLY,    
    @WorkFlowQueueId int
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    
    DECLARE @dccList TABLE (
        CreativeWorkflowQueueId int null,
        DigitalCampaignCreativeId int null,
        WorkFlowQueueId int null,
        CurrentIndicator varchar(1) collate SQL_Latin1_General_CP1_CI_AS null,
        LastUpdatedDate datetime null
    )

    DECLARE @DCIDList TABLE(
        DigitalCampaignCreativeId int null
    )





        DECLARE @res TABLE (
        MergeAction VARCHAR(50) collate SQL_Latin1_General_CP1_CI_AS ,
        CreativeWorkFlowQueueId INT, 
        _Position INT
        )

    BEGIN TRANSACTION t1

    BEGIN TRY
        INSERT INTO @dccList (CreativeWorkflowQueueId, DigitalCampaignCreativeId,LastUpdatedDate,WorkFlowQueueId,CurrentIndicator)
        select CreativeWorkflowQueueId, DigitalCampaignCreativeId,LastUpdatedDate,WorkFlowQueueId, 'N' as CurrentIndicator from 
        dbo.CreativeWorkFlowQueue Where CurrentIndicator = 'Y' 
        and IsDeleted = 0
        and DigitalCampaignCreativeId In 
        (SELECT DigitalCampaignCreativeId FROM VRF.DigitalCampaignCreative 
        WHERE IsDeleted = 0 and SfClosed = 0 
        and DccId in (Select DccId COLLATE SQL_Latin1_General_CP1_CI_AS from @tbl)
        )
         
         INSERT INTO @DCIDList 
         SELECT DigitalCampaignCreativeId FROM @dccList
         GROUP BY DigitalCampaignCreativeId

        INSERT INTO @dccList (DigitalCampaignCreativeId,WorkFlowQueueId,CurrentIndicator)
        select DigitalCampaignCreativeId, @WorkFlowQueueId as WorkFlowQueueId, 'Y' as CurrentIndicator from 
        @DCIDList


        MERGE vrf.CreativeWorkFlowQueue a
        USING 
            (
            SELECT 
                x.CreativeWorkflowQueueId,
                x.DigitalCampaignCreativeId,
                x.LastUpdatedDate,
                x.WorkFlowQueueId,
                x.CurrentIndicator 
            FROM @dccList x
            ) stg  
    
        ON stg.CreativeWorkflowQueueId = a.CreativeWorkflowQueueId

        WHEN MATCHED THEN
            UPDATE SET 
                a.CurrentIndicator  = stg.CurrentIndicator,
                a.LastUpdatedDate = getutcdate()
        WHEN NOT MATCHED THEN
            INSERT 
                (
                    CurrentIndicator,
                    DigitalCampaignCreativeId,
                    WorkFlowQueueId
                )
            VALUES 
                (
                    stg.CurrentIndicator, 
                    stg.DigitalCampaignCreativeId, 
                    stg.WorkFlowQueueId
                )  
            -- ********************************************************************
            -- Remove this if you don't need to return the results below.
            OUTPUT 
                INSERTED.CreativeWorkFlowQueueId,
                $action 
            INTO @res (CreativeWorkFlowQueueId, MergeAction);
            -- ********************************************************************


        COMMIT TRANSACTION t1

    END TRY
    BEGIN CATCH

        DECLARE @ErrorMessage NVARCHAR(MAX), @ErrorSeverity INT, @ErrorState INT;
        SELECT @ErrorMessage = ERROR_MESSAGE() + ' Line ' + CAST(ERROR_LINE() AS NVARCHAR(5)), @ErrorSeverity = ERROR_SEVERITY(), @ErrorState = ERROR_STATE();
        ROLLBACK TRANSACTION t1
        --RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState);
        SELECT 'FAILED' MergeAction,
                s.CreativeWorkflowQueueId,
                s.DigitalCampaignCreativeId,
                '' DccId,
                s.WorkFlowQueueId,
                s.CurrentIndicator,
                null CreateDate,
                null LastUpdatedDate,
                null IsDeleted,
                @ErrorMessage ErrorMessage
        FROM @dccList s
    END CATCH


    -- Normally, I would not have this.  But this will simulate
    -- what EF does if you need it.
    SELECT 
        r.MergeAction,
        a.CreativeWorkFlowQueueId,
        a.DigitalCampaignCreativeId,
        d.DccId,
        a.WorkFlowQueueId,
        a.CurrentIndicator,
        a.CreateDate, 
        a.LastUpdatedDate,
        a.IsDeleted,
        '' ErrorMessage
    FROM vrf.CreativeWorkFlowQueue a 
    JOIN @res r ON a.CreativeWorkFlowQueueId = r.CreativeWorkFlowQueueId
    JOIN vrf.DigitalCampaignCreative d ON a.DigitalCampaignCreativeId = d.DigitalCampaignCreativeId
    ORDER BY 
        r.MergeAction,
        r._Position


END

The User-Defined Table Type is this.

CREATE TYPE (dbo).(DCCIdList) AS TABLE(
    (DccId) (nvarchar)(18) NULL
)

PostgreSQL connection URI fails, but parameters work

Running postgreSQL 13.2 with ssl on.

I need to connect to a database from a third party application that requires a connection URI, but it is not working. So I tested connecting with psql using two different formats with the same credentials. One worked and one didn’t.

The following command logs me into mydb as user myuser:

# psql -U myuser -d mydb -h 127.0.0.1 -p 5432 -W
Password:
psql (13.2 (Debian 13.2-1.pgdg100+1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.

mydb=>

However this command fails:

# psql postgresql://myuser:MYPASSWORD@127.0.0.1:5432/mydb?sslmode=require
psql: error: FATAL: password authentication failed for user "myuser"

I am using exactly the same credentials. I’ve verified it more than 10 times. Removing “sslmode=require” does not fix the problem.

My pg_hba.conf file contains:

host   mydb   myuser   127.0.0.1/32   password

I made it the first line in my pg_hba.conf file, so it can’t be getting hung up on any other line.

What am I doing wrong?

Java EE / JSF and Nginx: uploading files fails when server behind Nginx

with JSF 2.3, Jakarta EE 8 and Wildfly 23 / Payara 5

Uploading a file with <h:input> or <p:fileUpload> works fine but fails when Nginx is turned on. The file is never received by the backing bean.

  1. is there any configuration to add to the server? (Payara or Wildfly)
  2. the Nginx config file has surely errors in it?

app.conf:

upstream payara{
    least_conn;

    server localhost:8080 max_fails=3 fail_timeout=5s;
    server localhost:8181 max_fails=3 fail_timeout=5s;
}
server {
    if ($host = nocodefunctions.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen        80;
    access_log /var/log/nginx/payara-access.log;
    error_log /var/log/nginx/payara-error.log;
    #Replace with your domain
    server_name   nocodefunctions.com;
    return        301 https://$host$request_uri;


}

server {
    listen        443 ssl;
    server_name   nocodefunctions.com;
    ssl_certificate /etc/letsencrypt/live/xxxxx/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/xxxxx/privkey.pem; # managed by Certbot

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";

    location /nocodeapp-web-front-1.0 {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-Proto https;
           
            proxy_connect_timeout      240;
            proxy_send_timeout         240;
            proxy_read_timeout         240;  
            proxy_http_version 1.1;

            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_pass http://payara$request_uri;
    }
    
    location = / {
            proxy_pass http://payara;
            return 301 https://nocodefunctions.com/nocodeapp-web-front-1.0;
    }

}

updates – can I still upgrade ubuntu16.04 – GUI and terminal upgrade fails

I am unable to upgrade 16.04LTS. GUI upgrade does nothing at all but Terminal commands are fine until this step:

$ sudo do-release-upgrade

“Checking for a new Ubuntu release
Please install all available updates for your release before upgrading”.

Have updated and tried this several times without success.
I know it is now past the EOL date but is there a way to still upgrade to the next LTS version?

postgresql – Postgres uuid_generate_v1() fails with INSERT from SELECT

I’m having trouble getting the uuid_generate_v1/v4() functions to work when doing a bulk insert:

create schema if not exists uuid_default_bug;

-- ensure uuid extension is added
create extension if not exists "uuid-ossp" with schema public;
alter extension "uuid-ossp" set schema public;

-- add source table & value
drop table if exists uuid_default_bug.test_source;
create table uuid_default_bug.test_source (
    name text not null
);
insert into uuid_default_bug.test_source (name) values ('test1');
insert into uuid_default_bug.test_source (name) values ('test2');

-- add target table
drop table if exists uuid_default_bug.test_target;
create table uuid_default_bug.test_target (
    -- set the uuid_generate function to use for the default value:
    id uuid not null default public.uuid_generate_v1(),
    name text
);


-- This line fails:
insert into uuid_default_bug.test_target select name from uuid_default_bug.test_source;

-- (42804) ERROR: column "id" is of type uuid but expression is of type text
-- Hint: You will need to rewrite or cast the expression. Position: 49

Note the last line insert into ... select fails with (42804) ERROR: column "id" is of type uuid but expression is of type text but both the id and the uuid_generate_v1() are of type uuid. Is there a way to fix this?

This happens on Postgres 12.5 and 13.2 with uuid-ossp v1.1.