8 – Fix for “‘csrf_token’ URL query argument is invalid” error during logout

I am creating a set of API endpoints for a mobile app using Rest. For User authentication, I am using the default API endpoints supplied by Drupal. That would be

/user/logout?_format=json&token=<logout_token obtained from login api response.>

I wanted to remove the _format=json from the URL parameter and so I created a custom route with the existing controller just for this purpose. However, I am getting an error.

"'csrf_token' URL query argument is invalid

I am not able to figure out how to remove this error. I had added a csrf_token as an additional parameter with the one I got from successful login. It seems however that the csrf token being validated against is generated somewhere else.

I can remove this error by removing the csrf token entry from the routing file entry but that would be a security violation. How do we fix this error or is there a better way to handle the user logout api endpoint.

views – PHP error in the log after PHP and Drupal upgrade

I got this error message in the log but not sure what is it about and how to fix it. Has anyone seen the same issue before and know how to fix it? Thank you so much!

DrupalCoreEntityEntityMalformedException: The “view” entity cannot have a URI as it does not have an ID in DrupalCoreEntityEntityBase->toUrl() (line 192 of /var/www/drupal_dev_8.8.6/core/lib/Drupal/Core/Entity/EntityBase.php)

relocation error: symbol SSL_trace version OPENSSL_1_1_0 not defined in file libssl.so.1.1 with link time reference

I compiled libssl.so and libcrypto.so using openssl1.1.1d using command ./config -d enable-ssl-trace.
when i use libssl.so and libcrypto.so and run my the apps. it show me this relocation error. i checked libssl.map and found SSL_trace is it OPENSSL_1_1_0 global feature. May I know how can I make it defined in file libssl.so.1.1?

google cloud platform – ERROR: (gcloud.app.deploy) Error Response: [13] Flex operation

PLS HELP!!! I already checked all the quotas and they seem to be fine. Don’t know what cause the error?

Updating service (default) (this may take several minutes)…failed.

ERROR: (gcloud.app.deploy) Error Response: (13) Flex operation projects/objreg-278609/regions/us-central1/operations/214e2dcc-8a7a-4204-898a-580dc14e6a97 error (INTERNAL): An internal error occurred while processing task /appengine-flex-v1/insert_flex_deployment/flex_create_resources>2020-05-28T10:58:17.771Z15266.ow.8: Deployment Manager operation objreg-278609/operation-1590663498298-5a6b334c5f340-589a82aa-ed20dd6f errors: (code: “RESOURCE_ERROR”
location: “/deployments/aef-default-20200528t054325/resources/aef-default-20200528t054325”
message: “{“ResourceType”:”compute.beta.regionAutoscaler”,”ResourceErrorCode”:”403″,”ResourceErrorMessage”:{“code”:403,”errors”:({“domain”:”usageLimits”,”message”:”Exceeded limit ‘QUOTA_FOR_INSTANCES’ on resource ‘aef-default-20200528t054325’. Limit: 8.0″,”reason”:”limitExceeded”}),”message”:”Exceeded limit ‘QUOTA_FOR_INSTANCES’ on resource ‘aef-default-20200528t054325’. Limit: 8.0″,”statusMessage”:”Forbidden”,”requestPath”:”https://compute.googleapis.com/compute/beta/projects/objreg-278609/regions/us-central1/autoscalers”,”httpMethod”:”POST”}}”
)

magento2 – Data Migration – EAV Step error – SQL syntax error

Magento v 2.3.5-p1; data Migration Tool v2.3.5

I created a custom module for setting up the config.xml for migration.

The migration for settings went ok.
At the data migration I encountered the following error:

enter image description here

Does anyone have any idea how to fix or what to check in order for the migration to be ok?

The rest of the data is migrated fine (products, orders, cms etc), but some attributes doesn’t show the value on the product view in admin.

networking – Ping ip works but got “Temporary failure in name resolution” error pinging hosts

I have two Debian virtual machines named “server” and “client”. The settings are mostly the same.

When I ping “debian.org” on “server” I got no issue, but when I try pinging “client”, I got the “Temporary failure in name resolution” error. However pinging the ip addresses works.

My setings on “client”:

hans@client:~$ ip a s enp1s0
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast    state UP group default qlen 1000
link/ether 52:54:00:2b:40:ab brd ff:ff:ff:ff:ff:ff
inet 192.168.122.76/24 brd 192.168.122.255 scope global dynamic enp1s0
   valid_lft 3273sec preferred_lft 3273sec
inet6 fe80::5054:ff:fe2b:40ab/64 scope link 
   valid_lft forever preferred_lft forever
hans@client:~$ ip r
default via 192.168.122.1 dev enp1s0 
192.168.122.0/24 dev enp1s0 proto kernel scope link src 192.168.122.76 
hans@client:~$ cat /etc/resolv.conf
nameserver 192.168.122.1
hans@client:~$ ls -l /etc/resolv.conf 
-rw-r--r-- 1 root root 25 May 28 06:46 /etc/resolv.conf
hans@client:~$ 

My settings on “server”:

hans@server:~$ ip a s enp1s0
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:fa:5f:f7 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.153/24 brd 192.168.122.255 scope global dynamic enp1s0
   valid_lft 2905sec preferred_lft 2905sec
inet6 fe80::5054:ff:fefa:5ff7/64 scope link 
   valid_lft forever preferred_lft forever
hans@server:~$ ip r
default via 192.168.122.1 dev enp1s0 
192.168.122.0/24 dev enp1s0 proto kernel scope link src 192.168.122.153 
hans@server:~$ cat /etc/resolv.conf
nameserver 192.168.122.1
hans@server:~$ ls -l /etc/resolv.conf
-rw-r--r-- 1 root root 25 May 28 06:46 /etc/resolv.conf
hans@server:~$ 

Pinging on “client”:

hans@client:~$ ping debian.org
ping: debian.org: Temporary failure in name resolution
hans@client:~$ ping 149.20.4.15
PING 149.20.4.15 (149.20.4.15) 56(84) bytes of data.
64 bytes from 149.20.4.15: icmp_seq=1 ttl=52 time=263 ms
64 bytes from 149.20.4.15: icmp_seq=2 ttl=52 time=256 ms
64 bytes from 149.20.4.15: icmp_seq=3 ttl=52 time=257 ms

--- 149.20.4.15 ping statistics ---
^C3 packets transmitted, 3 received, 0% packet loss, time 6ms
rtt min/avg/max/mdev = 256.464/258.557/262.566/2.835 ms
hans@client:~$ 

Pinging on “server”:

hans@server:~$ ping debian.org
PING debian.org (149.20.4.15) 56(84) bytes of data.
64 bytes from mirror-isc3.debian.org (149.20.4.15): icmp_seq=1 ttl=52 time=258 ms
64 bytes from mirror-isc3.debian.org (149.20.4.15): icmp_seq=2 ttl=52 time=257 ms
64 bytes from mirror-isc3.debian.org (149.20.4.15): icmp_seq=3 ttl=52 time=257 ms
^C
--- debian.org ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 8ms
rtt min/avg/max/mdev = 256.509/257.156/257.560/0.746 ms
hans@server:~$ 

the /etc/nsswitch.conf files on both hosts are the same.

user behavior – Error notice vs upgrade banner

We have two distinct styles for the following:

  • An error message (which is a red/black banner at the top of the page)
  • An upgrade message (which is a light-colored banner prompting the user to upgrade their plan)

We are restricting video uploads to users on a Free plan. When they attempt to upload, we inform them that this is only possible when they upgrade their plan.

In this case, which prompt should we use? An error message prompting them to upgrade, or a basic upgrade message? I was thinking about the latter so it isn’t so scary for the user.

arithmetic – Help comparing relative error for different parenthesizations of addition

I am given two functions:
$ fl(fl(x+y)+z) $ and $ fl(x+fl(y+z)) $ and asked to derive their relative error. Then, given a set of conditions:

a) $ x < y < x $

b) $ x > 0, y < 0, z > 0 $

c) $ x < 0, y > 0, z < 0 $

determine which parenthesization has less relative error.

After some algebra I determined the following relative errors where

$ epsilon_1 = RE(fl(x+y)), epsilon_2 = RE(fl(fl(x+y)+z) $

$ epsilon_3 = RE(fl(y+z)), epsilon_4 = RE(fl(x+fl(y+z)) $

$$
left| epsilon_2 + frac{(x+y)}{(x + y + z)}epsilon_1 right| text{and}
left| epsilon_4 + frac{(y+z)}{(x + y + z)}epsilon_3 right|
$$

I determined that for the case $ x < y < z, fl(fl(x + y) + z $ has less relative error. With the largest variable, $ z $ in the denominator alone, as $ z rightarrow infty $ the coefficient of $ epsilon_1 $ would approach $ 0 $.

But for $ x > 0, y < 0, z > 0 $ I’m struggling to generalize anything. I don’t see how a conclusion can be drawn without an ordering between $z$ and $x$. And what about when $ y = x + z $? Although this case is independent of the relative parenthesizations. And similarly for the case $ x < 0, y > 0, z < 0 $.

angular – HttpInterceptor not calling Global Error Handler

I am performing a spike to investigate the global error handler within Angular, I am trying to simulate client side and server side errors but when I force a http error(fake end point) the errors seem to get outputted to the console instead of getting dealt with the error handler, meaning they don’t even call through to the error handler.

ErrorHandler

@Injectable({
  providedIn: 'root'
})
export class GlobalErrorHandler implements ErrorHandler {

  constructor(private injector: Injector) { }

    handleError(error: Error | HttpErrorResponse): void {
      const errorService = this.injector.get(ErrorService);
      const notifier = this.injector.get(NotificationService);

      let message;
      let stackTrace;
      if(error instanceof HttpErrorResponse){
          //Server error
          message = errorService.getServerMessage(error);
          stackTrace = errorService.getServerStack(error);
      }else{
          //Client Error
          message = errorService.getClientMessage(error);
          stackTrace = errorService.getClientStack(error);
      }
      notifier.showError(message);
    }
}

Interceptor

export class ServerErrorInterceptorService implements HttpInterceptor {

  constructor() { }

    intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
        return next.handle(req).pipe(
            catchError((error: HttpErrorResponse) => {
                if (error.error instanceof ErrorEvent) {
                    // client-side error or network error

                } else {
                    // TODO: Clean up following by introducing method
                    if (error.status === 498) {
                        // TODO: Destroy local session; redirect to /login
                    }
                    if (error.status === 401) {
                        // TODO: Permission denied; show toast
                    }
                }
                return throwError(error);
            })
        )
    }
}

Module provider:

providers: (
    { provide: ErrorHandler, useClass: GlobalErrorHandler },
    { provide: HTTP_INTERCEPTORS, useClass: ServerErrorInterceptorService, multi: true}
)

and component:

    export class ErrorHandlingComponent implements OnInit {

  constructor(private httpClient: HttpClient) { }

  numberArray: number();

  ngOnInit() {
  }

  causeError(){
       this.numberArray(-1) = 1;
  }

    causeServerSideError() {
        this.httpClient.get("STUB URL").subscribe((x: number()) => this.numberArray = x)
    }
}