Explore all Cloud open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Cloud

Reloader

v0.0.108

kubernetes-ingress-controller

v2.3.1

odo

v2.3.1

microshift

Latest Nightly Build

kubo-deployment

kubo-deployment 0.44.0

Popular Libraries in Cloud

Reloader

by stakater doticongodoticon

star image 3152 doticonApache-2.0

A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!

kubernetes-ingress-controller

by Kong doticongodoticon

star image 1653 doticonApache-2.0

:gorilla: Kong for Kubernetes: The official Ingress Controller for Kubernetes.

odo

by openshift doticongodoticon

star image 587 doticonApache-2.0

odo - Developer-focused CLI for OpenShift and Kubernetes

kube-solo-osx

by TheNewNormal doticonshelldoticon

star image 579 doticonApache-2.0

Local development Kubernetes Solo Cluster for macOS made very simple

microshift

by redhat-et doticongodoticon

star image 295 doticonApache-2.0

A small form factor OpenShift/Kubernetes optimized for edge computing

kubo-deployment

by cloudfoundry-incubator doticonshelldoticon

star image 282 doticonApache-2.0

Contains manifests used to deploy Cloud Foundry Container Runtime

openshift-examples

by debianmaster doticongodoticon

star image 247 doticon

Openshift Examples - This repo does not provide end to end example but rather act as a rough draft for my work. use with caution. Buzzme at @twitter

stratos

by cloudfoundry doticontypescriptdoticon

star image 240 doticonApache-2.0

Stratos: Web-based Management UI for Cloud Foundry and Kubernetes

diego-release

by cloudfoundry doticonhtmldoticon

star image 201 doticonApache-2.0

BOSH Release for Diego

Trending New libraries in Cloud

microshift

by redhat-et doticongodoticon

star image 295 doticonApache-2.0

A small form factor OpenShift/Kubernetes optimized for edge computing

move2kube

by konveyor doticongodoticon

star image 178 doticonApache-2.0

Move2Kube is a command-line tool for automating creation of Infrastructure as code (IaC) artifacts. It has inbuilt support for creating IaC artifacts for replatforming to Kubernetes/Openshift.

gitops-operator

by redhat-developer doticongodoticon

star image 79 doticonApache-2.0

An operator that gets you an ArgoCD for cluster configuration out-of-the-box on OpenShift along with the UI for visualizing environments.

group-sync-operator

by redhat-cop doticongodoticon

star image 70 doticonApache-2.0

Synchronizes groups from external providers into OpenShift

assisted-service

by openshift doticongodoticon

star image 68 doticonApache-2.0

dynatrace-operator

by Dynatrace doticongodoticon

star image 53 doticonApache-2.0

Kubernetes / OpenShift operator to manage Dynatrace ActiveGate lifecycle

rosa

by openshift doticongodoticon

star image 48 doticonApache-2.0

visits-ios

by hypertrack doticonswiftdoticon

star image 41 doticonMIT

Visits app (iOS) built with HyperTrack

oadp-operator

by openshift doticongodoticon

star image 38 doticonApache-2.0

OADP Operator

Top Authors in Cloud

1

openshift

36 Libraries

star icon1708

2

cloudfoundry

33 Libraries

star icon1419

3

cloudfoundry-attic

28 Libraries

star icon270

4

cloudfoundry-community

28 Libraries

star icon450

5

cloud-gov

14 Libraries

star icon146

6

cloudfoundry-incubator

12 Libraries

star icon482

7

redhat-cop

7 Libraries

star icon398

8

pivotal-cf

7 Libraries

star icon63

9

vmware-archive

7 Libraries

star icon26

10

worldline

7 Libraries

star icon45

1

36 Libraries

star icon1708

2

33 Libraries

star icon1419

3

28 Libraries

star icon270

4

28 Libraries

star icon450

5

14 Libraries

star icon146

6

12 Libraries

star icon482

7

7 Libraries

star icon398

8

7 Libraries

star icon63

9

7 Libraries

star icon26

10

7 Libraries

star icon45

Trending Kits in Cloud

No Trending Kits are available at this moment for Cloud

Trending Discussions on Cloud

How to solve Invalid credentials problem in bitbucket?

Bitbucket Cloud recently stopped supporting account passwords for Git authentication

Spring Cloud Gateway; Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway Issue

how to specify to not allow any data backup with android:dataExtractionRules and

Can't deploy Cloud Functions because of "Unhandled error cleaning up build images"

App Engine Python 2.7 - ImportError: cannot import name apiproxy

Google app engine deployment fails- Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')

Netlify says, "error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0)"—yet I have the newest Node version?

App Store Connect Upload Error "You haven't been given access to cloud-managed distribution certificates"

Python 3.10 pattern matching (PEP 634) - wildcard in string

QUESTION

How to solve Invalid credentials problem in bitbucket?

Asked 2022-Mar-31 at 13:55

My bitbucket password is correct because I can easily login with this password. When I try to push a project or file to bitbucket it shows Invalid credentials error.

1$ git push -u origin master
2fatal: Invalid credentials
3Password for 'https://username@bitbucket.org':
4remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
5remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
6remote: App passwords are recommended for most use cases and can be created in your Personal settings:
7remote: https://bitbucket.org/account/settings/app-passwords/
8fatal: Authentication failed for 'https://bitbucket.org/username/demo.git/'
9

How can I solve this issue?

ANSWER

Answered 2022-Mar-07 at 11:47

Go to credential Manager -> Windown Credential -> Add a generic credential fill up the fields Network address: git:https://bitbucket.org Username: App Password: Solver from Here

Source https://stackoverflow.com/questions/71378839

QUESTION

Bitbucket Cloud recently stopped supporting account passwords for Git authentication

Asked 2022-Mar-16 at 20:19

I have pushed the code in the morning it was working fine but now I'm trying to push code but getting this error: Bitbucket Cloud recently stopped supporting account passwords for Git authentication

ANSWER

Answered 2022-Mar-15 at 05:06

I've also faced this issue..

  1. Then I opened my Bitbucket account. 2)Then at the bottom left corner you will find an icon with your username's initials. 3)Click on that and go to settings and click on Personal Settings 4)In personal Settings, in the left panel you will find "access management"
  2. Under that you will find "app passwords"
  3. Click on that --> Then you will routed to create app password page
  4. There you can give the required permissions and create password (Note: You have to store that password somewhere as it will be displayed only once) 8)When you push the code to any repo...use your app password instead of your account password (No need to change any settings in the git_config file)

Happy programming :) !

Source https://stackoverflow.com/questions/71472009

QUESTION

Spring Cloud Gateway; Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway Issue

Asked 2022-Mar-16 at 07:16

I got this below error when run the API-GATEWAY, I tried so many ways but I couldn't solve this issue.

Description:

Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.

Action:

Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.

Main Class

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16

application.yml

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44

pom.xml

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44<?xml version="1.0" encoding="UTF-8"?>
45<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
47    <modelVersion>4.0.0</modelVersion>
48    <parent>
49        <groupId>org.springframework.boot</groupId>
50        <artifactId>spring-boot-starter-parent</artifactId>
51        <version>2.5.3</version>
52        <relativePath/> <!-- lookup parent from repository -->
53    </parent>
54    <groupId>com.sample.apigateway</groupId>
55    <artifactId>apigateway</artifactId>
56    <version>0.0.1-SNAPSHOT</version>
57    <name>apigateway</name>
58    <description>Demo project for Spring Boot</description>
59    <properties>
60        <java.version>11</java.version>
61        <spring-cloud.version>2020.0.3</spring-cloud.version>
62    </properties>
63    <dependencies>
64        <dependency>
65            <groupId>org.springframework.boot</groupId>
66            <artifactId>spring-boot-starter-actuator</artifactId>
67        </dependency>
68        <dependency>
69            <groupId>org.springframework.boot</groupId>
70            <artifactId>spring-boot-starter-webflux</artifactId>
71        </dependency>
72        <dependency>
73            <groupId>io.springfox</groupId>
74            <artifactId>springfox-boot-starter</artifactId>
75            <version>3.0.0</version>
76        </dependency>
77        <dependency>
78            <groupId>org.springframework.cloud</groupId>
79            <artifactId>spring-cloud-starter-gateway</artifactId>
80        </dependency>
81        <dependency>
82            <groupId>org.springframework.cloud</groupId>
83            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
84        </dependency>
85        <dependency>
86            <groupId>org.springframework.cloud</groupId>
87            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
88        </dependency>
89
90        <dependency>
91            <groupId>org.springframework.boot</groupId>
92            <artifactId>spring-boot-starter-test</artifactId>
93            <scope>test</scope>
94        </dependency>
95    </dependencies>
96    <dependencyManagement>
97        <dependencies>
98            <dependency>
99                <groupId>org.springframework.cloud</groupId>
100                <artifactId>spring-cloud-dependencies</artifactId>
101                <version>${spring-cloud.version}</version>
102                <type>pom</type>
103                <scope>import</scope>
104            </dependency>
105        </dependencies>
106    </dependencyManagement>
107
108    <build>
109        <plugins>
110            <plugin>
111                <groupId>org.springframework.boot</groupId>
112                <artifactId>spring-boot-maven-plugin</artifactId>
113            </plugin>
114        </plugins>
115    </build>
116
117</project>
118

Full Error Message

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44<?xml version="1.0" encoding="UTF-8"?>
45<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
47    <modelVersion>4.0.0</modelVersion>
48    <parent>
49        <groupId>org.springframework.boot</groupId>
50        <artifactId>spring-boot-starter-parent</artifactId>
51        <version>2.5.3</version>
52        <relativePath/> <!-- lookup parent from repository -->
53    </parent>
54    <groupId>com.sample.apigateway</groupId>
55    <artifactId>apigateway</artifactId>
56    <version>0.0.1-SNAPSHOT</version>
57    <name>apigateway</name>
58    <description>Demo project for Spring Boot</description>
59    <properties>
60        <java.version>11</java.version>
61        <spring-cloud.version>2020.0.3</spring-cloud.version>
62    </properties>
63    <dependencies>
64        <dependency>
65            <groupId>org.springframework.boot</groupId>
66            <artifactId>spring-boot-starter-actuator</artifactId>
67        </dependency>
68        <dependency>
69            <groupId>org.springframework.boot</groupId>
70            <artifactId>spring-boot-starter-webflux</artifactId>
71        </dependency>
72        <dependency>
73            <groupId>io.springfox</groupId>
74            <artifactId>springfox-boot-starter</artifactId>
75            <version>3.0.0</version>
76        </dependency>
77        <dependency>
78            <groupId>org.springframework.cloud</groupId>
79            <artifactId>spring-cloud-starter-gateway</artifactId>
80        </dependency>
81        <dependency>
82            <groupId>org.springframework.cloud</groupId>
83            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
84        </dependency>
85        <dependency>
86            <groupId>org.springframework.cloud</groupId>
87            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
88        </dependency>
89
90        <dependency>
91            <groupId>org.springframework.boot</groupId>
92            <artifactId>spring-boot-starter-test</artifactId>
93            <scope>test</scope>
94        </dependency>
95    </dependencies>
96    <dependencyManagement>
97        <dependencies>
98            <dependency>
99                <groupId>org.springframework.cloud</groupId>
100                <artifactId>spring-cloud-dependencies</artifactId>
101                <version>${spring-cloud.version}</version>
102                <type>pom</type>
103                <scope>import</scope>
104            </dependency>
105        </dependencies>
106    </dependencyManagement>
107
108    <build>
109        <plugins>
110            <plugin>
111                <groupId>org.springframework.boot</groupId>
112                <artifactId>spring-boot-maven-plugin</artifactId>
113            </plugin>
114        </plugins>
115    </build>
116
117</project>
1182021-07-30 23:12:02.420  WARN 19032 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration]: Constructor threw exception; nested exception is org.springframework.cloud.gateway.support.MvcFoundOnClasspathException
1192021-07-30 23:12:02.423  INFO 19032 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
1202021-07-30 23:12:02.441  INFO 19032 --- [           main] ConditionEvaluationReportLoggingListener : 
121
122Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
1232021-07-30 23:12:02.454 ERROR 19032 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
124
125***************************
126APPLICATION FAILED TO START
127***************************
128
129Description:
130
131Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.
132
133Action:
134
135Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
136
137
138Process finished with exit code 1
139

ANSWER

Answered 2021-Aug-01 at 06:17

Please note that Spring Cloud Gateway is not compatible with Spring MVC (spring-boot-starter-web). This is outlined in section "How to include Spring Cloud Gateway in the official reference documentation":

Spring Cloud Gateway is built on Spring Boot 2.x, Spring WebFlux, and Project Reactor. As a consequence, many of the familiar synchronous libraries (Spring Data and Spring Security, for example) and patterns you know may not apply when you use Spring Cloud Gateway.

Additionally, it is stated that:

Spring Cloud Gateway requires the Netty runtime provided by Spring Boot and Spring Webflux. It does not work in a traditional Servlet Container or when built as a WAR.

As already suggested by the error message, you would need to remove the dependency on spring-boot-starter-web. You can list all your direct and transitive dependencies with the following command:

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44<?xml version="1.0" encoding="UTF-8"?>
45<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
47    <modelVersion>4.0.0</modelVersion>
48    <parent>
49        <groupId>org.springframework.boot</groupId>
50        <artifactId>spring-boot-starter-parent</artifactId>
51        <version>2.5.3</version>
52        <relativePath/> <!-- lookup parent from repository -->
53    </parent>
54    <groupId>com.sample.apigateway</groupId>
55    <artifactId>apigateway</artifactId>
56    <version>0.0.1-SNAPSHOT</version>
57    <name>apigateway</name>
58    <description>Demo project for Spring Boot</description>
59    <properties>
60        <java.version>11</java.version>
61        <spring-cloud.version>2020.0.3</spring-cloud.version>
62    </properties>
63    <dependencies>
64        <dependency>
65            <groupId>org.springframework.boot</groupId>
66            <artifactId>spring-boot-starter-actuator</artifactId>
67        </dependency>
68        <dependency>
69            <groupId>org.springframework.boot</groupId>
70            <artifactId>spring-boot-starter-webflux</artifactId>
71        </dependency>
72        <dependency>
73            <groupId>io.springfox</groupId>
74            <artifactId>springfox-boot-starter</artifactId>
75            <version>3.0.0</version>
76        </dependency>
77        <dependency>
78            <groupId>org.springframework.cloud</groupId>
79            <artifactId>spring-cloud-starter-gateway</artifactId>
80        </dependency>
81        <dependency>
82            <groupId>org.springframework.cloud</groupId>
83            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
84        </dependency>
85        <dependency>
86            <groupId>org.springframework.cloud</groupId>
87            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
88        </dependency>
89
90        <dependency>
91            <groupId>org.springframework.boot</groupId>
92            <artifactId>spring-boot-starter-test</artifactId>
93            <scope>test</scope>
94        </dependency>
95    </dependencies>
96    <dependencyManagement>
97        <dependencies>
98            <dependency>
99                <groupId>org.springframework.cloud</groupId>
100                <artifactId>spring-cloud-dependencies</artifactId>
101                <version>${spring-cloud.version}</version>
102                <type>pom</type>
103                <scope>import</scope>
104            </dependency>
105        </dependencies>
106    </dependencyManagement>
107
108    <build>
109        <plugins>
110            <plugin>
111                <groupId>org.springframework.boot</groupId>
112                <artifactId>spring-boot-maven-plugin</artifactId>
113            </plugin>
114        </plugins>
115    </build>
116
117</project>
1182021-07-30 23:12:02.420  WARN 19032 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration]: Constructor threw exception; nested exception is org.springframework.cloud.gateway.support.MvcFoundOnClasspathException
1192021-07-30 23:12:02.423  INFO 19032 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
1202021-07-30 23:12:02.441  INFO 19032 --- [           main] ConditionEvaluationReportLoggingListener : 
121
122Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
1232021-07-30 23:12:02.454 ERROR 19032 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
124
125***************************
126APPLICATION FAILED TO START
127***************************
128
129Description:
130
131Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.
132
133Action:
134
135Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
136
137
138Process finished with exit code 1
139mvn dependency:tree
140

This will reveal that spring-cloud-starter-netflix-eureka-server depends on spring-boot-starter-web. Once you remove the following lines from your pom.xml, your application should start up:

1package com.sample.apigateway;
2
3import org.springframework.boot.SpringApplication;
4import org.springframework.boot.autoconfigure.SpringBootApplication;
5import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
6
7@SpringBootApplication
8@EnableEurekaClient
9public class ApiGatewayApplication {
10
11    public static void main(String[] args) {
12        SpringApplication.run(ApiGatewayApplication.class, args);
13    }
14
15}
16spring:
17  application:
18    name: GATEWAY-SERVICE
19
20  cloud:
21    gateway:
22      routes:
23        - id: USER-SERVICE
24          uri: lb://USER-SERVICE
25          predicates:
26            - Path=/users/**
27        - id: DEPARTMENT-SERVICE
28          uri: lb://DEPARTMENT-SERVICE
29          predicates:
30            - Path=/departments/**
31
32eureka:
33  client:
34    register-with-eureka: true
35    fetch-registry: true
36    service-url:
37      defaultZone: http://localhost:8761/eureka/
38
39  instance:
40    hostname: localhost
41
42server:
43  port: 9191
44<?xml version="1.0" encoding="UTF-8"?>
45<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
47    <modelVersion>4.0.0</modelVersion>
48    <parent>
49        <groupId>org.springframework.boot</groupId>
50        <artifactId>spring-boot-starter-parent</artifactId>
51        <version>2.5.3</version>
52        <relativePath/> <!-- lookup parent from repository -->
53    </parent>
54    <groupId>com.sample.apigateway</groupId>
55    <artifactId>apigateway</artifactId>
56    <version>0.0.1-SNAPSHOT</version>
57    <name>apigateway</name>
58    <description>Demo project for Spring Boot</description>
59    <properties>
60        <java.version>11</java.version>
61        <spring-cloud.version>2020.0.3</spring-cloud.version>
62    </properties>
63    <dependencies>
64        <dependency>
65            <groupId>org.springframework.boot</groupId>
66            <artifactId>spring-boot-starter-actuator</artifactId>
67        </dependency>
68        <dependency>
69            <groupId>org.springframework.boot</groupId>
70            <artifactId>spring-boot-starter-webflux</artifactId>
71        </dependency>
72        <dependency>
73            <groupId>io.springfox</groupId>
74            <artifactId>springfox-boot-starter</artifactId>
75            <version>3.0.0</version>
76        </dependency>
77        <dependency>
78            <groupId>org.springframework.cloud</groupId>
79            <artifactId>spring-cloud-starter-gateway</artifactId>
80        </dependency>
81        <dependency>
82            <groupId>org.springframework.cloud</groupId>
83            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
84        </dependency>
85        <dependency>
86            <groupId>org.springframework.cloud</groupId>
87            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
88        </dependency>
89
90        <dependency>
91            <groupId>org.springframework.boot</groupId>
92            <artifactId>spring-boot-starter-test</artifactId>
93            <scope>test</scope>
94        </dependency>
95    </dependencies>
96    <dependencyManagement>
97        <dependencies>
98            <dependency>
99                <groupId>org.springframework.cloud</groupId>
100                <artifactId>spring-cloud-dependencies</artifactId>
101                <version>${spring-cloud.version}</version>
102                <type>pom</type>
103                <scope>import</scope>
104            </dependency>
105        </dependencies>
106    </dependencyManagement>
107
108    <build>
109        <plugins>
110            <plugin>
111                <groupId>org.springframework.boot</groupId>
112                <artifactId>spring-boot-maven-plugin</artifactId>
113            </plugin>
114        </plugins>
115    </build>
116
117</project>
1182021-07-30 23:12:02.420  WARN 19032 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration$SpringMvcFoundOnClasspathConfiguration]: Constructor threw exception; nested exception is org.springframework.cloud.gateway.support.MvcFoundOnClasspathException
1192021-07-30 23:12:02.423  INFO 19032 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
1202021-07-30 23:12:02.441  INFO 19032 --- [           main] ConditionEvaluationReportLoggingListener : 
121
122Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
1232021-07-30 23:12:02.454 ERROR 19032 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
124
125***************************
126APPLICATION FAILED TO START
127***************************
128
129Description:
130
131Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.
132
133Action:
134
135Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
136
137
138Process finished with exit code 1
139mvn dependency:tree
140<dependency>
141    <groupId>org.springframework.cloud</groupId>
142    <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
143</dependency>
144

Source https://stackoverflow.com/questions/68587832

QUESTION

how to specify to not allow any data backup with android:dataExtractionRules and

Asked 2022-Mar-01 at 12:45

My current android application targets 12 and higher.

I do not want to allow backup of any type and currently have these manifest settings

1    android:allowBackup="false"
2    android:fullBackupContent="false"
3    
4

however the android:allowBackup="false" setting gives the following warning now

1    android:allowBackup="false"
2    android:fullBackupContent="false"
3    
4The attribute android:allowBackup is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute android:dataExtractionRules specifying an @xml resource which configures cloud backups and device transfers on Android 12 and higher.
5

Ive looked at the examples for android:dataExtractionRules xml and none of them show how to configure the equivalent of allowBackup="false".

what am i missing?

is it possible to achieve allowBackup="false" with the use of android:dataExtractionRules xml

ANSWER

Answered 2022-Feb-10 at 15:28

It's usually better to disable backups only for debug builds:

1    android:allowBackup="false"
2    android:fullBackupContent="false"
3    
4The attribute android:allowBackup is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute android:dataExtractionRules specifying an @xml resource which configures cloud backups and device transfers on Android 12 and higher.
5<application
6    android:fullBackupContent="false"
7    tools:replace="android:fullBackupContent"
8    tools:ignore="DataExtractionRules,MissingApplicationIcon"/>
9

One can as well merge an alternate src/debug/res/xml/data_extraction_rules.xml.

Source https://stackoverflow.com/questions/70365809

QUESTION

Can't deploy Cloud Functions because of "Unhandled error cleaning up build images"

Asked 2022-Feb-10 at 19:11

I've deployed hundreds of function and this is the first time I encounter this issue. Simply, it stops deploying function process, saying:

Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/gcr/images/[project-name]/us/gcf

The way I deploy is through Firebase CLI command: firebase deploy --only functions:nameOfFunction

Question is what are those images I have to delete? Why? How can I solve it?

ANSWER

Answered 2021-Aug-01 at 15:56

Cloud Functions uses another product called Cloud Build to build the server images that actually get deployed. Those images are stored in Cloud Storage, and that storage is billed to your account.

Read more about it:

Watch:

You should be able to locate and delete the files manually in the Google Cloud console. But it sounds like there is a bug here with the files not being cleaned up automatically, so you contact Firebase support directly.

Source https://stackoverflow.com/questions/68611817

QUESTION

App Engine Python 2.7 - ImportError: cannot import name apiproxy

Asked 2022-Feb-08 at 08:52

With the upgrade to Google Cloud SDK 360.0.0-0 i started seeing the following error when running the dev_appserver.py command for my Python 2.7 App Engine project.

1  File "/home/..................py", line 6, in <module>
2    from google.appengine.ext import ndb
3  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/__init__.py", line 22, in <module>
4    from tasklets import *
5  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/tasklets.py", line 85, in <module>
6    from .google_imports import apiproxy_stub_map
7  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/google_imports.py", line 44, in <module>
8    from google.appengine.runtime import apiproxy as callback
9ImportError: cannot import name apiproxy
10

gcloud version

1  File "/home/..................py", line 6, in <module>
2    from google.appengine.ext import ndb
3  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/__init__.py", line 22, in <module>
4    from tasklets import *
5  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/tasklets.py", line 85, in <module>
6    from .google_imports import apiproxy_stub_map
7  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/google_imports.py", line 44, in <module>
8    from google.appengine.runtime import apiproxy as callback
9ImportError: cannot import name apiproxy
10Google Cloud SDK 360.0.0
11alpha 2021.10.04
12app-engine-python 1.9.95
13app-engine-python-extras 1.9.95
14beta 2021.10.04
15bq 2.0.71
16cloud-build-local 0.5.2
17cloud-datastore-emulator 2.1.0
18core 2021.10.04
19gsutil 5.3
20

ANSWER

Answered 2022-Feb-08 at 08:52
EDIT

This issue seems to have been resolved with Google Cloud SDK version 371


On my debian based system i fixed it by downgrading the app-engine-python component to the previous version

1  File "/home/..................py", line 6, in <module>
2    from google.appengine.ext import ndb
3  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/__init__.py", line 22, in <module>
4    from tasklets import *
5  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/tasklets.py", line 85, in <module>
6    from .google_imports import apiproxy_stub_map
7  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/google_imports.py", line 44, in <module>
8    from google.appengine.runtime import apiproxy as callback
9ImportError: cannot import name apiproxy
10Google Cloud SDK 360.0.0
11alpha 2021.10.04
12app-engine-python 1.9.95
13app-engine-python-extras 1.9.95
14beta 2021.10.04
15bq 2.0.71
16cloud-build-local 0.5.2
17cloud-datastore-emulator 2.1.0
18core 2021.10.04
19gsutil 5.3
20sudo apt-get install google-cloud-sdk-app-engine-python=359.0.0-0
21sudo apt-get install google-cloud-sdk-app-engine-python-extras=359.0.0-0
22

gcloud version (after downgrade)

1  File "/home/..................py", line 6, in <module>
2    from google.appengine.ext import ndb
3  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/__init__.py", line 22, in <module>
4    from tasklets import *
5  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/tasklets.py", line 85, in <module>
6    from .google_imports import apiproxy_stub_map
7  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/google_imports.py", line 44, in <module>
8    from google.appengine.runtime import apiproxy as callback
9ImportError: cannot import name apiproxy
10Google Cloud SDK 360.0.0
11alpha 2021.10.04
12app-engine-python 1.9.95
13app-engine-python-extras 1.9.95
14beta 2021.10.04
15bq 2.0.71
16cloud-build-local 0.5.2
17cloud-datastore-emulator 2.1.0
18core 2021.10.04
19gsutil 5.3
20sudo apt-get install google-cloud-sdk-app-engine-python=359.0.0-0
21sudo apt-get install google-cloud-sdk-app-engine-python-extras=359.0.0-0
22Google Cloud SDK 360.0.0
23alpha 2021.10.04
24app-engine-python 1.9.94
25app-engine-python-extras 1.9.95
26beta 2021.10.04
27bq 2.0.71
28cloud-build-local 0.5.2
29cloud-datastore-emulator 2.1.0
30core 2021.10.04
31gsutil 5.3
32

I created an issue for this bug: https://issuetracker.google.com/issues/202171426

Source https://stackoverflow.com/questions/69465376

QUESTION

Google app engine deployment fails- Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')

Asked 2022-Jan-08 at 22:02

We are using command prompt c:\gcloud app deploy app.yaml, but get the following error:

1Running "python3 -m pip install --requirement requirements.txt --upgrade --upgrade-strategy only-if-needed --no-warn-script-location --no-warn-conflicts --force-reinstall --no-compile (PIP_CACHE_DIR=/layers/google.python.pip/pipcache PIP_DISABLE_PIP_VERSION_CHECK=1)"
2Step #2 - "build": /layers/google.python.pip/pip/bin/python3: Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')
3Step #2 - "build": Done "python3 -m pip install --requirement requirements.txt --upgr..." (34.49892ms)
4Step #2 - "build": Failure: (ID: 0ea8a540) /layers/google.python.pip/pip/bin/python3: Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')
5Step #2 - "build": --------------------------------------------------------------------------------
6Step #2 - "build": Running "mv -f /builder/outputs/output-5577006791947779410 /builder/outputs/output"
7Step #2 - "build": Done "mv -f /builder/outputs/output-5577006791947779410 /builder/o..." (12.758866ms)
8Step #2 - "build": ERROR: failed to build: exit status 1
9Finished Step #2 - "build"
10ERROR
11ERROR: build step 2 "us.gcr.io/gae-runtimes/buildpacks/python37/builder:python37_20211201_3_7_12_RC00" failed: step exited with non-zero status: 145
12

Our Requirements.txt is as below. We are currently on Python 3.7 standard app engine

1Running "python3 -m pip install --requirement requirements.txt --upgrade --upgrade-strategy only-if-needed --no-warn-script-location --no-warn-conflicts --force-reinstall --no-compile (PIP_CACHE_DIR=/layers/google.python.pip/pipcache PIP_DISABLE_PIP_VERSION_CHECK=1)"
2Step #2 - "build": /layers/google.python.pip/pip/bin/python3: Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')
3Step #2 - "build": Done "python3 -m pip install --requirement requirements.txt --upgr..." (34.49892ms)
4Step #2 - "build": Failure: (ID: 0ea8a540) /layers/google.python.pip/pip/bin/python3: Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')
5Step #2 - "build": --------------------------------------------------------------------------------
6Step #2 - "build": Running "mv -f /builder/outputs/output-5577006791947779410 /builder/outputs/output"
7Step #2 - "build": Done "mv -f /builder/outputs/output-5577006791947779410 /builder/o..." (12.758866ms)
8Step #2 - "build": ERROR: failed to build: exit status 1
9Finished Step #2 - "build"
10ERROR
11ERROR: build step 2 "us.gcr.io/gae-runtimes/buildpacks/python37/builder:python37_20211201_3_7_12_RC00" failed: step exited with non-zero status: 145
12firebase_admin==3.0.0
13sendgrid==6.9.3
14google-auth==1.35.0
15google-auth-httplib2==0.1.0
16jinja2==3.0.3
17MarkupSafe==2.0.1
18pytz==2021.3
19Flask==2.0.2
20twilio==6.46.0
21httplib2==0.20.2
22requests==2.24.0
23requests_toolbelt==0.9.1
24google-cloud-tasks==2.7.1
25google-cloud-logging==1.15.1
26googleapis-common-protos==1.54.0
27

Please help.The above code was working well before updating the requirements.txt file. We tried to remove gunicorn to allow the system pickup the latest according to documentation here.

We have a subdirectory structure that stores all the .py files in controllers and db definitions in models. Our main.py has the following -

1Running "python3 -m pip install --requirement requirements.txt --upgrade --upgrade-strategy only-if-needed --no-warn-script-location --no-warn-conflicts --force-reinstall --no-compile (PIP_CACHE_DIR=/layers/google.python.pip/pipcache PIP_DISABLE_PIP_VERSION_CHECK=1)"
2Step #2 - "build": /layers/google.python.pip/pip/bin/python3: Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')
3Step #2 - "build": Done "python3 -m pip install --requirement requirements.txt --upgr..." (34.49892ms)
4Step #2 - "build": Failure: (ID: 0ea8a540) /layers/google.python.pip/pip/bin/python3: Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')
5Step #2 - "build": --------------------------------------------------------------------------------
6Step #2 - "build": Running "mv -f /builder/outputs/output-5577006791947779410 /builder/outputs/output"
7Step #2 - "build": Done "mv -f /builder/outputs/output-5577006791947779410 /builder/o..." (12.758866ms)
8Step #2 - "build": ERROR: failed to build: exit status 1
9Finished Step #2 - "build"
10ERROR
11ERROR: build step 2 "us.gcr.io/gae-runtimes/buildpacks/python37/builder:python37_20211201_3_7_12_RC00" failed: step exited with non-zero status: 145
12firebase_admin==3.0.0
13sendgrid==6.9.3
14google-auth==1.35.0
15google-auth-httplib2==0.1.0
16jinja2==3.0.3
17MarkupSafe==2.0.1
18pytz==2021.3
19Flask==2.0.2
20twilio==6.46.0
21httplib2==0.20.2
22requests==2.24.0
23requests_toolbelt==0.9.1
24google-cloud-tasks==2.7.1
25google-cloud-logging==1.15.1
26googleapis-common-protos==1.54.0
27sys.path.append(os.path.join(os.path.dirname(__file__), '../controllers'))
28sys.path.append(os.path.join(os.path.dirname(__file__), '../models'))
29

Does anyone know how to debug this error - Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__'). What does this mean?

ANSWER

Answered 2022-Jan-06 at 09:24

Your setuptools version is likely to be yanked:

https://pypi.org/project/setuptools/60.3.0/

Not sure how to fix that without a working pip though.

Source https://stackoverflow.com/questions/70602290

QUESTION

Netlify says, "error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0)"—yet I have the newest Node version?

Asked 2022-Jan-08 at 07:21

After migrating from Remark to MDX, my builds on Netlify are failing.

I get this error when trying to build:

110:13:28 AM: $ npm run build
210:13:29 AM: > blog-gatsby@0.1.0 build /opt/build/repo
310:13:29 AM: > gatsby build
410:13:30 AM: error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0).
510:13:30 AM: Upgrade Node to the latest stable release: https://gatsby.dev/upgrading-node-js
6

Yet when I run node -v in my terminal, it says v17.2.0.

I assume it's not a coincidence that this happened after migrating. Can the problem be because of my node-modules folder? Or is there something in my gatsby-config.js or package.json files I need to change?

My package.json file:

110:13:28 AM: $ npm run build
210:13:29 AM: > blog-gatsby@0.1.0 build /opt/build/repo
310:13:29 AM: > gatsby build
410:13:30 AM: error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0).
510:13:30 AM: Upgrade Node to the latest stable release: https://gatsby.dev/upgrading-node-js
6{
7  "name": "blog-gatsby",
8  "private": true,
9  "description": "A starter for a blog powered by Gatsby and Markdown",
10  "version": "0.1.0",
11  "author": "Magnus Kolstad <kolstadmagnus@gmail.com>",
12  "bugs": {
13    "url": "https://kolstadmagnus.no"
14  },
15  "dependencies": {
16    "@mdx-js/mdx": "^1.6.22",
17    "@mdx-js/react": "^1.6.22",
18    "gatsby": "^4.3.0",
19    "gatsby-plugin-feed": "^4.3.0",
20    "gatsby-plugin-gatsby-cloud": "^4.3.0",
21    "gatsby-plugin-google-analytics": "^4.3.0",
22    "gatsby-plugin-image": "^2.3.0",
23    "gatsby-plugin-manifest": "^4.3.0",
24    "gatsby-plugin-mdx": "^3.4.0",
25    "gatsby-plugin-offline": "^5.3.0",
26    "gatsby-plugin-react-helmet": "^5.3.0",
27    "gatsby-plugin-sharp": "^4.3.0",
28    "gatsby-remark-copy-linked-files": "^5.3.0",
29    "gatsby-remark-images": "^6.3.0",
30    "gatsby-remark-prismjs": "^6.3.0",
31    "gatsby-remark-responsive-iframe": "^5.3.0",
32    "gatsby-remark-smartypants": "^5.3.0",
33    "gatsby-source-filesystem": "^4.3.0",
34    "gatsby-transformer-sharp": "^4.3.0",
35    "prismjs": "^1.25.0",
36    "react": "^17.0.1",
37    "react-dom": "^17.0.1",
38    "react-helmet": "^6.1.0",
39    "typeface-merriweather": "0.0.72",
40    "typeface-montserrat": "0.0.75"
41  },
42  "devDependencies": {
43    "prettier": "^2.4.1"
44  },
45  "homepage": "https://kolstadmagnus.no",
46  "keywords": [
47    "blog"
48  ],
49  "license": "0BSD",
50  "main": "n/a",
51  "repository": {
52    "type": "git",
53    "url": "git+https://github.com/gatsbyjs/gatsby-starter-blog.git"
54  },
55  "scripts": {
56    "build": "gatsby build",
57    "develop": "gatsby develop",
58    "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
59    "start": "gatsby develop",
60    "serve": "gatsby serve",
61    "clean": "gatsby clean",
62    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
63  }
64}
65

What am I doing wrong here?


Update #1
110:13:28 AM: $ npm run build
210:13:29 AM: > blog-gatsby@0.1.0 build /opt/build/repo
310:13:29 AM: > gatsby build
410:13:30 AM: error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0).
510:13:30 AM: Upgrade Node to the latest stable release: https://gatsby.dev/upgrading-node-js
6{
7  "name": "blog-gatsby",
8  "private": true,
9  "description": "A starter for a blog powered by Gatsby and Markdown",
10  "version": "0.1.0",
11  "author": "Magnus Kolstad <kolstadmagnus@gmail.com>",
12  "bugs": {
13    "url": "https://kolstadmagnus.no"
14  },
15  "dependencies": {
16    "@mdx-js/mdx": "^1.6.22",
17    "@mdx-js/react": "^1.6.22",
18    "gatsby": "^4.3.0",
19    "gatsby-plugin-feed": "^4.3.0",
20    "gatsby-plugin-gatsby-cloud": "^4.3.0",
21    "gatsby-plugin-google-analytics": "^4.3.0",
22    "gatsby-plugin-image": "^2.3.0",
23    "gatsby-plugin-manifest": "^4.3.0",
24    "gatsby-plugin-mdx": "^3.4.0",
25    "gatsby-plugin-offline": "^5.3.0",
26    "gatsby-plugin-react-helmet": "^5.3.0",
27    "gatsby-plugin-sharp": "^4.3.0",
28    "gatsby-remark-copy-linked-files": "^5.3.0",
29    "gatsby-remark-images": "^6.3.0",
30    "gatsby-remark-prismjs": "^6.3.0",
31    "gatsby-remark-responsive-iframe": "^5.3.0",
32    "gatsby-remark-smartypants": "^5.3.0",
33    "gatsby-source-filesystem": "^4.3.0",
34    "gatsby-transformer-sharp": "^4.3.0",
35    "prismjs": "^1.25.0",
36    "react": "^17.0.1",
37    "react-dom": "^17.0.1",
38    "react-helmet": "^6.1.0",
39    "typeface-merriweather": "0.0.72",
40    "typeface-montserrat": "0.0.75"
41  },
42  "devDependencies": {
43    "prettier": "^2.4.1"
44  },
45  "homepage": "https://kolstadmagnus.no",
46  "keywords": [
47    "blog"
48  ],
49  "license": "0BSD",
50  "main": "n/a",
51  "repository": {
52    "type": "git",
53    "url": "git+https://github.com/gatsbyjs/gatsby-starter-blog.git"
54  },
55  "scripts": {
56    "build": "gatsby build",
57    "develop": "gatsby develop",
58    "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
59    "start": "gatsby develop",
60    "serve": "gatsby serve",
61    "clean": "gatsby clean",
62    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
63  }
64}
657:11:59 PM: failed Building production JavaScript and CSS bundles - 20.650s
667:11:59 PM: error Generating JavaScript bundles failed
677:11:59 PM: Module build failed (from ./node_modules/url-loader/dist/cjs.js):
687:11:59 PM: Error: error:0308010C:digital envelope routines::unsupported
697:11:59 PM:     at new Hash (node:internal/crypto/hash:67:19)
707:11:59 PM:     at Object.createHash (node:crypto:130:10)
717:11:59 PM:     at getHashDigest (/opt/build/repo/node_modules/file-loader/node_modules/loader-utils/lib/getHashDigest.js:46:34)
727:11:59 PM:     at /opt/build/repo/node_modules/file-loader/node_modules/loader-utils/lib/interpolateName.js:113:11
737:11:59 PM:     at String.replace (<anonymous>)
747:11:59 PM:     at interpolateName (/opt/build/repo/node_modules/file-loader/node_modules/loader-utils/lib/interpolateName.js:110:8)
757:11:59 PM:     at Object.loader (/opt/build/repo/node_modules/file-loader/dist/index.js:29:48)
767:11:59 PM:     at Object.loader (/opt/build/repo/node_modules/url-loader/dist/index.js:127:19)
777:11:59 PM: ​
787:11:59 PM: ────────────────────────────────────────────────────────────────
797:11:59 PM:   "build.command" failed                                        
807:11:59 PM: ────────────────────────────────────────────────────────────────
817:11:59 PM: ​
827:11:59 PM:   Error message
837:11:59 PM:   Command failed with exit code 1: npm run build
847:11:59 PM: ​
857:11:59 PM:   Error location
867:11:59 PM:   In Build command from Netlify app:
877:11:59 PM:   npm run build
887:11:59 PM: ​
897:11:59 PM:   Resolved config
907:11:59 PM:   build:
917:11:59 PM:     command: npm run build
927:11:59 PM:     commandOrigin: ui
937:11:59 PM:     publish: /opt/build/repo/public
947:11:59 PM:     publishOrigin: ui
957:11:59 PM:   plugins:
967:11:59 PM:     - inputs: {}
977:11:59 PM:       origin: ui
987:11:59 PM:       package: '@netlify/plugin-gatsby'
997:11:59 PM:   redirects:
1007:12:00 PM:     - from: /api/*
101      status: 200
102      to: /.netlify/functions/gatsby
103    - force: true
104      from: https://magnuskolstad.com
105      status: 301
106      to: https://kolstadmagnus.no
107  redirectsOrigin: config
108Caching artifacts
109

ANSWER

Answered 2022-Jan-08 at 07:21

The problem is that you have Node 17.2.0. locally but in Netlify's environment, you are running a lower version (by default it's not set as 17.2.0). So the local environment is OK, Netlify environment is KO because of this mismatch of Node versions.

When Netlify deploys your site it installs and builds again your site so you should ensure that both environments work under the same conditions. Otherwise, both node_modules will differ so your application will have different behavior or eventually won't even build because of dependency errors.

You can easily play with the Node version in multiple ways but I'd recommend using the .nvmrc file. Just run the following command in the root of your project:

110:13:28 AM: $ npm run build
210:13:29 AM: > blog-gatsby@0.1.0 build /opt/build/repo
310:13:29 AM: > gatsby build
410:13:30 AM: error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0).
510:13:30 AM: Upgrade Node to the latest stable release: https://gatsby.dev/upgrading-node-js
6{
7  "name": "blog-gatsby",
8  "private": true,
9  "description": "A starter for a blog powered by Gatsby and Markdown",
10  "version": "0.1.0",
11  "author": "Magnus Kolstad <kolstadmagnus@gmail.com>",
12  "bugs": {
13    "url": "https://kolstadmagnus.no"
14  },
15  "dependencies": {
16    "@mdx-js/mdx": "^1.6.22",
17    "@mdx-js/react": "^1.6.22",
18    "gatsby": "^4.3.0",
19    "gatsby-plugin-feed": "^4.3.0",
20    "gatsby-plugin-gatsby-cloud": "^4.3.0",
21    "gatsby-plugin-google-analytics": "^4.3.0",
22    "gatsby-plugin-image": "^2.3.0",
23    "gatsby-plugin-manifest": "^4.3.0",
24    "gatsby-plugin-mdx": "^3.4.0",
25    "gatsby-plugin-offline": "^5.3.0",
26    "gatsby-plugin-react-helmet": "^5.3.0",
27    "gatsby-plugin-sharp": "^4.3.0",
28    "gatsby-remark-copy-linked-files": "^5.3.0",
29    "gatsby-remark-images": "^6.3.0",
30    "gatsby-remark-prismjs": "^6.3.0",
31    "gatsby-remark-responsive-iframe": "^5.3.0",
32    "gatsby-remark-smartypants": "^5.3.0",
33    "gatsby-source-filesystem": "^4.3.0",
34    "gatsby-transformer-sharp": "^4.3.0",
35    "prismjs": "^1.25.0",
36    "react": "^17.0.1",
37    "react-dom": "^17.0.1",
38    "react-helmet": "^6.1.0",
39    "typeface-merriweather": "0.0.72",
40    "typeface-montserrat": "0.0.75"
41  },
42  "devDependencies": {
43    "prettier": "^2.4.1"
44  },
45  "homepage": "https://kolstadmagnus.no",
46  "keywords": [
47    "blog"
48  ],
49  "license": "0BSD",
50  "main": "n/a",
51  "repository": {
52    "type": "git",
53    "url": "git+https://github.com/gatsbyjs/gatsby-starter-blog.git"
54  },
55  "scripts": {
56    "build": "gatsby build",
57    "develop": "gatsby develop",
58    "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
59    "start": "gatsby develop",
60    "serve": "gatsby serve",
61    "clean": "gatsby clean",
62    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
63  }
64}
657:11:59 PM: failed Building production JavaScript and CSS bundles - 20.650s
667:11:59 PM: error Generating JavaScript bundles failed
677:11:59 PM: Module build failed (from ./node_modules/url-loader/dist/cjs.js):
687:11:59 PM: Error: error:0308010C:digital envelope routines::unsupported
697:11:59 PM:     at new Hash (node:internal/crypto/hash:67:19)
707:11:59 PM:     at Object.createHash (node:crypto:130:10)
717:11:59 PM:     at getHashDigest (/opt/build/repo/node_modules/file-loader/node_modules/loader-utils/lib/getHashDigest.js:46:34)
727:11:59 PM:     at /opt/build/repo/node_modules/file-loader/node_modules/loader-utils/lib/interpolateName.js:113:11
737:11:59 PM:     at String.replace (<anonymous>)
747:11:59 PM:     at interpolateName (/opt/build/repo/node_modules/file-loader/node_modules/loader-utils/lib/interpolateName.js:110:8)
757:11:59 PM:     at Object.loader (/opt/build/repo/node_modules/file-loader/dist/index.js:29:48)
767:11:59 PM:     at Object.loader (/opt/build/repo/node_modules/url-loader/dist/index.js:127:19)
777:11:59 PM: ​
787:11:59 PM: ────────────────────────────────────────────────────────────────
797:11:59 PM:   "build.command" failed                                        
807:11:59 PM: ────────────────────────────────────────────────────────────────
817:11:59 PM: ​
827:11:59 PM:   Error message
837:11:59 PM:   Command failed with exit code 1: npm run build
847:11:59 PM: ​
857:11:59 PM:   Error location
867:11:59 PM:   In Build command from Netlify app:
877:11:59 PM:   npm run build
887:11:59 PM: ​
897:11:59 PM:   Resolved config
907:11:59 PM:   build:
917:11:59 PM:     command: npm run build
927:11:59 PM:     commandOrigin: ui
937:11:59 PM:     publish: /opt/build/repo/public
947:11:59 PM:     publishOrigin: ui
957:11:59 PM:   plugins:
967:11:59 PM:     - inputs: {}
977:11:59 PM:       origin: ui
987:11:59 PM:       package: '@netlify/plugin-gatsby'
997:11:59 PM:   redirects:
1007:12:00 PM:     - from: /api/*
101      status: 200
102      to: /.netlify/functions/gatsby
103    - force: true
104      from: https://magnuskolstad.com
105      status: 301
106      to: https://kolstadmagnus.no
107  redirectsOrigin: config
108Caching artifacts
109node -v > .nvmrc
110

This should create a .nvmrc file containing the Node version (node -v) in it. When Netlify finds this file during the build process, it uses it as a base Node version so it installs all the dependencies accordingly.

The file is also useful to tell other contributors which Node version are you using.

Source https://stackoverflow.com/questions/70362755

QUESTION

App Store Connect Upload Error "You haven't been given access to cloud-managed distribution certificates"

Asked 2021-Dec-22 at 10:31

Uploading an iOS app to App Store Connect with Xcode (Automatically manage signing) and received this error:

Screenshot of Xcode error dialog

The following errors occurred while locating and generating signing assets. ...

Communication with Apple failed. You haven't been given access to cloud-managed distribution certificates. Please contact your team's Account Holder or an Admin to give you access. If you need further assistance, contact Apple Developer Program Support at https://developer.apple.com/support

I have checked:

  • the cert is installed and valid
  • I have access to Certificates, Identifiers & Profiles

ANSWER

Answered 2021-Oct-18 at 01:45

the cert is installed and valid

That doesn't matter. New in Xcode 13, if you choose Automatic signing, Apple tries to do cloud-based signing; it doesn't even see the certificate that's on your computer.

But you do not have the cloud-based signing privilege, so it fails.

You have two choices:

  • Get the privilege. It is really worth it, because cloud-based signing is great! It allows you to distribute from an archive to App Store Connect without having any distribution identity or distribution certificate at all. This totally solves the problem that there's only one distribution certificate at a time.

  • Switch to manual signing. Now the distribution certificate on your computer will be used. You'll need explicit access to the distribution profile too, obviously; the whole export resigning will be manual. That might be simplest if you're in a hurry.

Source https://stackoverflow.com/questions/69609859

QUESTION

Python 3.10 pattern matching (PEP 634) - wildcard in string

Asked 2021-Dec-17 at 10:43

I got a large list of JSON objects that I want to parse depending on the start of one of the keys, and just wildcard the rest. A lot of the keys are similar, like "matchme-foo" and "matchme-bar". There is a builtin wildcard, but it is only used for whole values, kinda like an else.

I might be overlooking something but I can't find a solution anywhere in the proposal:

https://docs.python.org/3/whatsnew/3.10.html#pep-634-structural-pattern-matching

Also a bit more about it in PEP-636:

https://www.python.org/dev/peps/pep-0636/#going-to-the-cloud-mappings

My data looks like this:

1data = [{
2          "id"     : "matchme-foo",
3          "message": "hallo this is a message",
4      },{
5          "id"     : "matchme-bar",
6          "message": "goodbye",
7      },{
8          "id"     : "anotherid",
9          "message": "completely diffrent event"
10      }, ...]
11

I want to do something that can match the id without having to make a long list of |'s.

Something like this:

1data = [{
2          "id"     : "matchme-foo",
3          "message": "hallo this is a message",
4      },{
5          "id"     : "matchme-bar",
6          "message": "goodbye",
7      },{
8          "id"     : "anotherid",
9          "message": "completely diffrent event"
10      }, ...]
11for event in data:
12    match event:
13        case {'id':'matchme-*'}: # Match all 'matchme-' no matter what comes next
14            log.INFO(event['message'])
15        case {'id':'anotherid'}:
16            log.ERROR(event['message'])
17

It's a relatively new addition to Python so there aren't many guides on how to use it yet.

ANSWER

Answered 2021-Dec-17 at 10:43

You can use a guard:

1data = [{
2          "id"     : "matchme-foo",
3          "message": "hallo this is a message",
4      },{
5          "id"     : "matchme-bar",
6          "message": "goodbye",
7      },{
8          "id"     : "anotherid",
9          "message": "completely diffrent event"
10      }, ...]
11for event in data:
12    match event:
13        case {'id':'matchme-*'}: # Match all 'matchme-' no matter what comes next
14            log.INFO(event['message'])
15        case {'id':'anotherid'}:
16            log.ERROR(event['message'])
17for event in data:
18    match event:
19        case {'id': x} if x.startswith("matchme"): # guard
20            print(event["message"])
21        case {'id':'anotherid'}:
22            print(event["message"])
23

Quoting from the official documentation,

Guard

We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated:

1data = [{
2          "id"     : "matchme-foo",
3          "message": "hallo this is a message",
4      },{
5          "id"     : "matchme-bar",
6          "message": "goodbye",
7      },{
8          "id"     : "anotherid",
9          "message": "completely diffrent event"
10      }, ...]
11for event in data:
12    match event:
13        case {'id':'matchme-*'}: # Match all 'matchme-' no matter what comes next
14            log.INFO(event['message'])
15        case {'id':'anotherid'}:
16            log.ERROR(event['message'])
17for event in data:
18    match event:
19        case {'id': x} if x.startswith("matchme"): # guard
20            print(event["message"])
21        case {'id':'anotherid'}:
22            print(event["message"])
23match point:
24     case Point(x, y) if x == y:
25         print(f"The point is located on the diagonal Y=X at {x}.")
26     case Point(x, y):
27         print(f"Point is not on the diagonal.")
28

Source https://stackoverflow.com/questions/70111401

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Cloud

Tutorials and Learning Resources are not available at this moment for Cloud

Share this Page

share link

Get latest updates on Cloud