AWS, Azure, and Google Cloud are the leading public vendors in cloud computing, offering a myriad of services and functionalities. The open-source community is heavily involved in this cloud trend. Open-source technologies provide the foundation for many public cloud services, and many enterprises are using these same technologies to build private clouds and hybrid clouds. In addition, many open-source projects offer cloud-based software-as-a-service (SaaS) versions of their applications.
Popular New Releases in Cloud
localstack
LocalStack release 0.14.2
microservices-demo
v0.3.6
sops
v3.7.2
go-cloud
v0.24.0
cortex
v0.42.0
Popular Libraries in Cloud
by localstack python
40029 NOASSERTION
π» A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline!
by open-guides shell
29988 CC-BY-4.0
π Amazon Web Services β a practical guide
by aws python
12274 NOASSERTION
Universal Command Line Interface for Amazon Web Services
by GoogleCloudPlatform python
12028 Apache-2.0
Sample cloud-native application with 10 microservices showcasing Kubernetes, Istio, gRPC and OpenCensus.
by ramitsurana shell
11943 NOASSERTION
A curated list for awesome kubernetes sources :ship::tada:
by Azure shell
11650 MIT
Azure Quickstart Templates
by donnemartin python
9608 NOASSERTION
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.
by mozilla go
9259 MPL-2.0
Simple and flexible tool for managing secrets
by aws-amplify typescript
8675 Apache-2.0
A declarative JavaScript library for application development using cloud services.
Trending New libraries in Cloud
by infracost go
6374 Apache-2.0
Cloud cost estimates for Terraform in pull requestsπ°π Love your cloud bill!
by microsoft go
3213 MIT
Linux OS for Azure 1P services and edge appliances
by MicrosoftLearning csharp
1391 MIT
AZ-204: Developing solutions for Microsoft Azure
by azure-rtos c
1280 NOASSERTION
Azure RTOS ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
by MicrosoftLearning powershell
1258 MIT
AZ-104 Microsoft Azure Administrator
by aws shell
1100 Apache-2.0
Amazon EKS Distro (EKS-D) is a Kubernetes distribution based on and used by Amazon Elastic Kubernetes Service (EKS) to create reliable and secure Kubernetes clusters.
by Azure python
1024 NOASSERTION
Azure Red Team tool for graphing Azure and Azure Active Directory objects
by Noovolari typescript
941 MPL-2.0
Leapp is the DevTool to access your cloud
by external-secrets go
914 Apache-2.0
External Secrets Operator reads information from a third-party service like AWS Secrets Manager and automatically injects the values as Kubernetes Secrets.
Top Authors in Cloud
1
418 Libraries
13271
2
413 Libraries
20599
3
404 Libraries
68389
4
252 Libraries
23913
5
154 Libraries
29934
6
130 Libraries
10583
7
115 Libraries
38623
8
86 Libraries
58337
9
84 Libraries
11461
10
64 Libraries
9170
1
418 Libraries
13271
2
413 Libraries
20599
3
404 Libraries
68389
4
252 Libraries
23913
5
154 Libraries
29934
6
130 Libraries
10583
7
115 Libraries
38623
8
86 Libraries
58337
9
84 Libraries
11461
10
64 Libraries
9170
Trending Kits in Cloud
Developing and deploying apps, managing infrastructure, monitoring, logging activity, and other development and operations procedures can all be automated using C-Sharp DevOps libraries. The programming language C# is frequently used to create various applications, including backend services, desktop, mobile, and web based. On the .NET platform, which offers a wealth of libraries and tools for creating, deploying, and maintaining applications, C# serves as the principal language for developing applications.
Building and deploying apps, managing infrastructure, and monitoring and logging are just a few development and operations processes that can be automated in DevOps using C# libraries. By automating and streamlining their operations, these libraries can aid developers, and DevOps engineers in producing higher-quality software more rapidly and effectively. DevOps aims to make it possible for businesses to produce higher-quality, more reliable, and quicker software. A software development process called DevOps strongly emphasizes teamwork, communication, and integration between IT operations teams and software developers. Azure Microsoft offers a suite of DevOps tools and services for creating, delivering, and managing applications. It is a cloud-based platform that interfaces with various tools and services, such as GitHub, Azure, and Visual Studio, to offer a full range of DevOps capabilities.
Check out the below list to find the best C# DevOps libraries for your application:
SimpleCV is an open-source framework for building computer vision applications using Python. It provides a high-level interface to various image processing and computer vision algorithms.
Those make it accessible to developers, and researchers. The hobbyists with varying levels of expertise in computer vision.
Key features of SimpleCV include:
- Image Processing
- Object Detection and Tracking
- Camera and Video Support
- Integration with OpenCV
- Interactive Shell
- Cross-Platform Compatibility
- Community and Documentation
SimpleCV aims to democratize computer vision by providing an easy-to-use yet powerful platform. The building applications range from simple image manipulation tasks to complex object detection. It is suitable for educational purposes, research projects, prototyping, and developing production-grade applications.
flask:
- Flask is a lightweight web framework for Python that allows you to build web apps.
- Flask makes it easy to generate HTTP responses. It includes HTML content, JSON data, redirects, and error pages.
- Flask is WSGI-compliant, meaning it can be deployed on any WSGI-compatible server.
numpy:
- NumPy is a fundamental package for scientific computing with Python.
- NumPy provides an array object is a multi-dimensional array of elements of the data type.
- NumPy supports broadcasting and allows arithmetic operations to be performed on arrays of shapes.
jquery:
- jQuery is a fast, lightweight, and feature-rich JavaScript library that simplifies client-side tasks.
- jQuery provides a simple and concise syntax for selecting and manipulating DOM elements.
- jQuery simplifies event handling by providing methods to attach events to DOM elements.
bootstrap:
- Bootstrap is a popular front-end framework for building responsive and mobile-first web projects.
- Bootstrap includes a responsive, mobile-first grid system based on a 12-column layout.
- Bootstrap provides CSS components for UI elements such as buttons, and forms.
celery:
- Celery is a task queue library for Python that helps you run background tasks or scheduled tasks.
- Celery includes support for scheduling tasks to run at specific times or intervals.
- Celery comes with tools and utilities for monitoring and managing task execution.
boto3:
- Boto3 is the Amazon Web Services (AWS) SDK for Python.
- It allows Python developers to easily interact with various AWS services.
- Boto3 offers a simple and intuitive API for interacting with AWS services.
azure-sdk-for-java:
- The Azure SDK is a set of libraries that enable Java to integrate their apps with various Azure services.
- The Azure SDK for Java supports a wide range of Azure services.
- The SDK supports asynchronous and reactive programming paradigms.
react:
- React is a JavaScript library for building user interfaces, particularly single-page applications.
- React enables you to break down your UI into reusable components.
- React uses a declarative syntax to UI look based on the application's state.
pytorch:
- PyTorch is an open-source machine learning library developed by Facebook's AI Research lab.
- PyTorch provides a powerful library for tensor operations similar to NumPy.
- PyTorch supports automatic differentiation through its autograd package.
fastapi:
- FastAPI is designed to be fast and highly performant, leveraging asynchronous request handling.
- FastAPI automatically generates interactive API documentation using OpenAPI and JSON Schema.
- FastAPI supports dependency injection for handling dependencies such as database connections.
cherrypy:
- CherryPy is an open-source web framework for building web applications in Python.
- CherryPy provides a flexible configuration system. It allows you to customize various aspects of your application.
- CherryPy includes built-in tools and plugins for common web development tasks.
FAQ
1.β―What is SimpleCV?
SimpleCV is an open-source framework for building computer vision applications using Python. It provides a high-level interface to various image processing and computer vision algorithms. Those make it accessible to developers, researchers, and hobbyists.
2.Why integrate SimpleCV with web applications?
Integrating SimpleCV with web apps allows to creation of interactive interfaces. The Web applications provide a platform-independent way to access. It interacts with computer vision functionality over the internet.
3.β―How can I integrate SimpleCV with web applications?
It can integrate SimpleCV with web applications by building web interfaces. The APIs that interact with SimpleCV's functionality. This can be done using web frameworks like Flask, Django, CherryPy, or FastAPI. To handle HTTP requests and responses and SimpleCV to perform image processing tasks.
4.β―What are some common use cases for integrating SimpleCV with web applications?
Common use cases include:
- Image classification and object detection: Allow users to upload images and perform classification or detection tasks using SimpleCV algorithms.
- Image filtering and enhancement: Provide tools for users to apply filters, adjust brightness/contrast, and perform other image enhancement techniques through a web interface.
- Real-time video processing: Stream video from a webcam or other source and apply real-time processing algorithms using SimpleCV.
5.β―Which web framework is best for integrating SimpleCV with web applications?
The choice of web framework depends on your specific requirements and preferences. The flask is lightweight and easy to use, making it suitable for small to medium-sized projects. Django is a full-featured framework with built-in authentication, ORM, and admin interface. This makes it suitable for larger and more complex applications. The frameworks like CherryPy and FastAPI offer trade-offs in performance, and ease of use.
Mb66 loans lΓ trang cΓ‘ cược hΓ ng ΔαΊ§u ChΓ’u Γ. Vα»i nhiα»u hΓ¬nh thα»©c cΓ‘ cược khΓ‘c nhay nhΖ° ΔΓ‘ gΓ , live casino, thα» thao, xα» sα», bαΊ―n cΓ‘... Nhiα»u khuyαΊΏn mΓ£i Δược sΔn ΔΓ³n hαΊ±ng ngΓ y tαΊ‘i trang chΓnh thα»©c Mb66.loans.
Website: https://mb66.loans/
Δα»a chα»: 286 LαΊ‘c Long QuΓ’n, PhΖ°α»ng 5, QuαΊn 11, ThΓ nh phα» Hα» ChΓ Minh, Viα»t Nam
SΔT: 0368547134
Email contact@mb66loans.com
Hastags: #mb66#mb66loans #nhacaimb66 #mb 66 #linkmb66 #mb66#trangchumb66
Social
https://www.facebook.com/mb66loans1/
https://www.youtube.com/@mb66loans
https://twitter.com/mb66loans50764
https://www.pinterest.com/mb66loans/
https://www.tumblr.com/mb66loans
https://www.reddit.com/user/mb66loans/
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:55My 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:47Go 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
QUESTION
Bitbucket Cloud recently stopped supporting account passwords for Git authentication
Asked 2022-Mar-16 at 20:19I 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:06I've also faced this issue..
- 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"
- Under that you will find "app passwords"
- Click on that --> Then you will routed to create app password page
- 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 :) !
QUESTION
Spring Cloud Gateway; Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway Issue
Asked 2022-Mar-16 at 07:16I 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:17Please 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
QUESTION
how to specify to not allow any data backup with android:dataExtractionRules and
Asked 2022-Mar-01 at 12:45My 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:28It'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
.
QUESTION
Can't deploy Cloud Functions because of "Unhandled error cleaning up build images"
Asked 2022-Feb-10 at 19:11I'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:56Cloud 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:
- https://github.com/firebase/firebase-tools/issues/3404
- https://krasimirtsonev.com/blog/article/firebase-gcp-saving-money
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.
QUESTION
App Engine Python 2.7 - ImportError: cannot import name apiproxy
Asked 2022-Feb-08 at 08:52With 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:52This 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
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:02We 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:24Your 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.
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:21After 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:21The 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.
QUESTION
App Store Connect Upload Error "You haven't been given access to cloud-managed distribution certificates"
Asked 2021-Dec-22 at 10:31Uploading an iOS app to App Store Connect with Xcode (Automatically manage signing) and received this error:
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:45the 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.
QUESTION
Python 3.10 pattern matching (PEP 634) - wildcard in string
Asked 2021-Dec-17 at 10:43I 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:43You 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 isfalse
, match goes on to try the nextcase
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
Community Discussions contain sources that include Stack Exchange Network