Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
Installing NMapsMap (3.16.0)
[!] Error installing NMapsMap
[!] /usr/bin/git clone <https://github.com/navermaps/NMapsMap.git> /var/folders/nd/lsjr321s7sxbss72ggwkq5sr0000gn/T/d20221118-42365-1i2mgxz --template= --single-branch --depth 1 --branch release/3.16.0
Cloning into '/var/folders/nd/lsjr321s7sxbss72ggwkq5sr0000gn/T/d20221118-42365-1i2mgxz'...
Note: switching to 'd34a86bee0756adf7e40636f12712315f8de975c'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
git-lfs filter-process: git-lfs: command not found
fatal: the remote end hung up unexpectedly
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
Couldn't install Pods. Updating the Pods project and trying again...
> pod install --repo-update
Auto-linking React Native modules for target `BSpotReactNative`: RNCAsyncStorage, RNScreens, RNVectorIcons, kakao-login, react-native-nmap, react-native-safe-area-context, and react-native-splash-screen
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Updating local specs repositories
CocoaPods 1.11.3 is available.
To update use: `gem install cocoapods`
For more information, see <https://blog.cocoapods.org> and the CHANGELOG for this version at <https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.3>
Analyzing dependencies
[Codegen] Found FBReactNativeSpec
Downloading dependencies
Installing Alamofire (5.6.2)
Installing KakaoSDKAuth (2.11.1)
Installing KakaoSDKCommon (2.11.1)
Installing KakaoSDKUser (2.11.1)
Installing NMapsMap (3.16.0)
[!] Error installing NMapsMap
[!] /usr/bin/git clone <https://github.com/navermaps/NMapsMap.git> /var/folders/nd/lsjr321s7sxbss72ggwkq5sr0000gn/T/d20221118-42481-1bq6ix8 --template= --single-branch --depth 1 --branch release/3.16.0
Cloning into '/var/folders/nd/lsjr321s7sxbss72ggwkq5sr0000gn/T/d20221118-42481-1bq6ix8'...
Note: switching to 'd34a86bee0756adf7e40636f12712315f8de975c'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
git-lfs filter-process: git-lfs: command not found
fatal: the remote end hung up unexpectedly
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
Couldn't install Pods. Updating the Pods project and trying again...
Command `pod install` failed.
└─ Cause: Error installing NMapsMap
[!] /usr/bin/git clone <https://github.com/navermaps/NMapsMap.git> /var/folders/nd/lsjr321s7sxbss72ggwkq5sr0000gn/T/d20221118-42481-1bq6ix8 --template= --single-branch --depth 1 --branch release/3.16.0
Cloning into '/var/folders/nd/lsjr321s7sxbss72ggwkq5sr0000gn/T/d20221118-42481-1bq6ix8'...
Note: switching to 'd34a86bee0756adf7e40636f12712315f8de975c'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
git-lfs filter-process: git-lfs: command not found
fatal: the remote end hung up unexpectedly
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
import logging.config
from gevent.monkey import patch_all
patch_all()
# 이 부분이 해결하기 위한 코드
# import grpc.experimental.gevent as grpc_gevent
# grpc_gevent.init_gevent()
from flask import Flask
from config.default import CONFIG
from views.pixel_view import bp
from config.logger import LOGGING_CONFIG
from views.scheduler import scheduler, get_destination_template
def create_app():
logging.config.dictConfig(LOGGING_CONFIG)
if CONFIG['APP_ENV'] == 'PRODUCTION':
logging.disable(logging.DEBUG)
else:
logging.disable(logging.NOTSET)
ap = Flask(__name__)
ap.url_map.strict_slashes = False
ap.register_blueprint(bp)
ap.config['SCHEDULER_API_ENABLED'] = True
if not scheduler.running:
scheduler.init_app(ap)
scheduler.start()
# break point
**get_destination_template()**
return ap
app = create_app()
logger = logging.getLogger('default')
if __name__ == '__main__':
logger.info('APP START AND POLL START')
app.run(port=5001)
위 코드를 보면 python cronjob도 돌리고있고 api서버의 기능도 있다.
스케줄링관련 프로세스에는 google 제품을 사용하는 코드들이 있다. bigtable요청관련된 부분이다.
그렇지만 위에 break point를 걸어보면 아래와 같은 코드에서 freezing이 걸린다.
def _run_channel_spin_thread(state):
def channel_spin():
while True:
#freezing point
cygrpc.block_if_fork_in_progress(state)
event = state.channel.next_call_event()
if event.completion_type == cygrpc.CompletionType.queue_timeout:
continue
call_completed = event.tag(event)
if call_completed:
with state.lock:
state.managed_calls -= 1
if state.managed_calls == 0:
return
channel_spin_thread = cygrpc.ForkManagedThread(target=channel_spin)
channel_spin_thread.setDaemon(True)
channel_spin_thread.start()
이 파일의 경로는 아래와 같다
grcp에서 프로세스를 fork하는 부분에서 freezing이 걸리는걸 확인하는 순간이다.
충돌이 일어난다고 볼수 있다.
이 부분을 해결하기 위해선 첫 코드에서 주석을 해제하는 코드를 작성해야한다.
import logging.config
from gevent.monkey import patch_all
patch_all()
# 이 부분이 해결하기 위한 코드
import grpc.experimental.gevent as grpc_gevent
grpc_gevent.init_gevent()
from flask import Flask
from config.default import CONFIG
from views.pixel_view import bp
from config.logger import LOGGING_CONFIG
from views.scheduler import scheduler, get_destination_template
def create_app():
logging.config.dictConfig(LOGGING_CONFIG)
if CONFIG['APP_ENV'] == 'PRODUCTION':
logging.disable(logging.DEBUG)
else:
logging.disable(logging.NOTSET)
ap = Flask(__name__)
ap.url_map.strict_slashes = False
ap.register_blueprint(bp)
ap.config['SCHEDULER_API_ENABLED'] = True
if not scheduler.running:
scheduler.init_app(ap)
scheduler.start()
# break point
**get_destination_template()**
return ap
app = create_app()
logger = logging.getLogger('default')
if __name__ == '__main__':
logger.info('APP START AND POLL START')
app.run(port=5001)
사용한 패키지 버전이다.
gevent = "~=21.8.0"
gunicorn = "~=20.1.0"
google제품과 사용 시 freezing현상이 있다면 이 부분을 확인해보면 도움이 될 거 같다.
1Airflow에서 mysql_default를 사용중에 localhost:3306을 설정하여 커넥션을 시도하였으나 실패하였다.
실패상황2
docker inspect containerId 를 통해서 내부 ip를 파악해여 커넥션을 시도하였으나 실패하였다.
이유가 무엇일까 생각해보니 네트워크가 서로 분리되어있었다.
mysql은 기본 네트워크 (bridge)에 존재하였고
airflow는 생성할때 입력한 네트워크에 container들과 함께 생성되었다.
# 네트워크 리스트 명령어
docker network ls
# 해당 네트워크에 어떤 컨테이너가 있는지, 또는 정보를 확인하는 명령어
docker network inspect networkName
# docker network inspect bridge
# docker network inspect "airflow network name"
서로 다른 네트워크에 존하는것을 확인하였다. 그렇다면 어떻게 해야할까 ?
내가 작업한 방법은 airflow network에 mysql container를 붙여서 내부 아이피를 사용하는 방법을 사용하였다.
2020-04-16 12:38:00.373 ERROR 1 --- [pool-1-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task
org.springframework.dao.DeadlockLoserDataAccessException: PreparedStatementCallback; SQL [DELETE FROM SPRING_SESSION WHERE EXPIRY_TIME < ?]; Deadlock found when trying to get lock; try restarting transaction; nested exception is com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:267) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1443) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:862) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:917) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:927) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.session.jdbc.JdbcIndexedSessionRepository.lambda$cleanUpExpiredSessions$8(JdbcIndexedSessionRepository.java:553) ~[spring-session-jdbc-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.session.jdbc.JdbcIndexedSessionRepository.cleanUpExpiredSessions(JdbcIndexedSessionRepository.java:553) ~[spring-session-jdbc-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_151]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_151]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_151]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Caused by: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:123) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1040) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1347) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1025) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HikariCP-3.4.2.jar!/:na]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-3.4.2.jar!/:na]
at org.springframework.jdbc.core.JdbcTemplate.lambda$update$0(JdbcTemplate.java:867) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:617) ~[spring-jdbc-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
Mysql 에서 자신의 Transaction Isolation Level을 확인하려면 다음과 같은 명령어를 사용한다
show variables like 'tx_isolation';
위의 에러는 REPEATABLE READ 라는 상태일 때 나타나게 된다.
참고 문서에 아래와 같이 나와있다.
REPEATABLE-READ에서는 현재 Select 버전을 보장하기 위해 Snapshot을 이용하는데,
이 경우 해당 데이터에 관해서 암묵적으로 Lock과 비슷한 효과가 나타납니다.
즉, Select 작업이 종료될 때까지 해당 데이터 변경 작업이 불가합니다.
tx_isolation 변수의 상태는 4가지가 있다.
READ UNCOMMITTED 다른 트랜잭션이 Commit 전 상태를 볼 수 있음Binary Log가 자동으로 Row Based로 기록됨 (Statement설정 불가, Mixed 설정 시 자동 변환)
READ-COMMITTED Commit된 내역을 읽을 수 있는 상태로, 트랜잭션이 다르더라도 특정 타 트랜잭션이 Commit을 수행하면 해당 데이터를 Read할 수 있음Binary Log가 자동으로 Row Based로 기록됨 (Statement설정 불가, Mixed 설정 시 자동 변환)
REPEATABLE READ MySQL InnoDB 스토리지 엔진의 Default Isolation LevelSelect 시 현재 데이터 버전의 Snapshot을 만들고, 그 Snapshot으로부터 데이터를 조회동일 트랜잭션 내에서 데이터 일관성을 보장하고 데이터를 다시 읽기 위해서는 트랜잭션을 다시 시작해야 함
SERIALIZABLE 가장 높은 Isolation Level로 트랜잭션이 완료될 때까지 SELECT 문장이 사용하는 모든 데이터에 Shared Lock이 걸림다른 트랜잭션에서는 해당 영역에 관한 데이터 변경 뿐만 아니라 입력도 불가
Oracle 에서는 READ-COMMITTED 상태가 Default 상태여서 해당 에러가 나타나지 않는다.
Mysql 의 tx_isolation변수값을 READ-COMMITTED 값으로 변경해야지 해당 에러가 발생하지 않는다.
ERROR in multi eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
Module not found: Error: Can't resolve 'eslint-loader' in '/Users/xxxxxx/Documents/GitHub/xxxxxxxx/frontend'
build: {
/* ** You can extend webpack config here */
extend(config, { isDev, isClient }) {
if (isDev && isClient) {
config.module.rules.push({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/,
options: { fix: true }
})
}
},
}
패키지를 설치해보자
npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @nuxtjs/eslint-module@3.0.2
npm ERR! node_modules/@nuxtjs/eslint-module
npm ERR! dev @nuxtjs/eslint-module@"^1.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @nuxtjs/eslint-module@"^1.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint@6.8.0
npm ERR! node_modules/eslint
npm ERR! peer eslint@"^5.0.0 || ^6.0.0" from @nuxtjs/eslint-module@1.2.0
npm ERR! node_modules/@nuxtjs/eslint-module
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/xxxxx/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lhs/.npm/_logs/2021-01-13T01_00_35_327Z-debug.log
애러 내용을 보면 Found: @nuxtjs/eslint-module@3.0.2 이 내용을 볼 수 있다.
해당 패키지의 버전을 3.0.2로 수정한다.
이제 nuxt 파일을 run 해보자.
npm run dev
빌드가 완료되고 페이지를 접속해보면 아래와 같은 에러 내용을 확인 할 수 있다.
ERROR in multi eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
Module not found: Error: Can't resolve 'eslint-loader' in '/Users/lhs/Documents/GitHub/xxxxxxxxxx/frontend'
Module not found: Error: Can't resolve 'eslint-loader' in '/Users/xxxxx/Documents/GitHub/xxxxxxxx/frontend'
eslint-loader 모듈을 찾을 수 없다는 내용이다.
pacakage-lock.json 파일을 1.0.0v / 3.0.2v 버전과 비교해보면
eslint-loader 내용이 빠져있는것을 확인할 수 있다.
해당 사이트를 확인해보니 eslint-loader가 depreected되었다는 내용을 찾아 볼 수 있었다.
1. 팀프로젝트가 있다면 가장 루트, 팀 레파지토리 화면에서 > Projects 메뉴에 들어간다.
2. New Project 버튼을 클릭한다.
3. Project를 생성화면으로써 알맞는 값들을 선택한다.
Template는 일단 None 선택을 한다.
4. 기존에 Repository를 만들어 두었다면 해당 프로젝트를 검색해서
Project와 Repository를 연결시켜준다.
5. 연결을 시켰다면 Create Project 버튼을 클릭하고 아래와 같은 화면이 보인다.
업무 프로세스를 추가하는 Column을 추가하는 화면이다.
6. Issue생성 기준으로 해당 컬럼에 자동으로 배치시키를 룰을 적용시킬수 있다. - To Do : 새로운 Issue가 생성될 경우 - In progress: 기존 이슈를 재오픈 할 경우 (강제로 In pregress로 변경 가능) - Done: Issue를 Done처리 할 경우
7. 총 3가지 단계로 구성해 보았다.
할일 > 작업중 > 끝
이렇게 해두면 사용자에게 내 할일을 생성하여 끝내는 프로세스까지 진행하도록 공유해주어야 한다.
사용자들은 일할 Repository에서 이슈생성해서 Done처리를 하면 팀 레파지토리> Projects에서 전체를 이슈를 모니터링 할 수 있다.
+ 추가적으로 연결된 프로젝트를 추가하려면 아래 사진 순서와 같이 작업하면 된다.
1. 팀 레파지토리 > Projects 화면에서 내가 만든 Project에서 아래 사진과 같이 클릭
2. Linked repositories 메뉴에서 Link a repositroy 클릭
3. 연결될 레파지토리를 검색해서 입력한다. ( 추가된 레파지토리는 만들어져있는 상태여야 한다. )
사용자 프로젝트 작업 가이드
1. 업무가 있는 프로젝트에서 Issues 메뉴로 들어온다.
2. New issue 버튼을 클릭한다.
3. New issue화면에서 제목, 내용 및 할당될사람, issue lables, 어떤 Projects에 붙일 것인지 등 내용을 채워 나간다.
Lables는 기본적으로 9가지가 있다. 해당내용은 커스텀이 가능하다. 관리자와 내용을 조율하여 관리한다.
milestone은 일정을 생성하여 적용할 수 있는 기능이다. 조금 번거로워 보인다.
3-1. 내용을 선택하는 화면이다. (참고)
4. 생성하고나면 이렇게 완료된 화면이 나온다.
+ 이렇게 추가된 프로젝트는 팀 레파지토리에서 관리되는 칸반보드에서 모두 확인이 가능하다.
+ Done처리 방법
1. 생성된 Issue에 들어가서 Close issue 버튼을 클릭한다.
2. 칸반보드에서 내용 확인
+ In progress 처리 방법
해당 issue화면에서 프로세스 상태값을 변경한다. 자동으로 할당도되는데 관리자와 해당 룰을 설명 받은뒤 사용자들에게 공유하면 될 것으로 보인다.