Translate

2022년 1월 15일 토요일

[JavaScript] iframe 뒤로가기 (history back) 이슈 원인과 해결방법

 

본문에 iframe 이 들어가는 상황에서 뒤로가기가 예상했던 동작대로 작동하지 않아 알아봤는데..

stackoverflow를 포함한 다른 많은 글을 읽어보았지만 원하는 방법을 보지 못하고 어떻게 할지 여러가지 방법으로 고민하고 연구한 방법에 대해서 기술을 해본다.


테스트 크롬 버전: 94, 96


이슈


 1. iframe 내에서 자동으로 여러 페이지로 리다이렉트 되거나 사용자의 액션으로 여러페이지 이동 시 history 에 해당 페이지들이 스택으로 쌓이게 된다.
 2. 특히나 컨텐츠가 iframe 하나가 아니라 여러개를 보여줘야 할 수도 있다.

 PS.
  - 페이지 이동이 없는 단일 페이지만 iframe 내에서 보여지는 거라면 크게 문제되지 않는다.



여러가지 방법으로 테스트를 해봤을 때 다음과 같은 결론과 방법을 찾았다.

1004lucifer

뒤로가기 (Alt + ←) 는 현재로써는 완벽하게 커버 가능하지 않다.

history.back 또는 history.go 수행시 발생하는 popstate 이벤트(링크)를 통해 현재 화면에 iframe이 있는지 확인하고 iframe의 주소가 현재 사이트와 다른경우 계속해서 history.back()을 하려 했는데..

브라우저의 뒤로가기 버튼을 누르거나 뒤로가기 단축키를 이용 시 iframe 내부에서 이전페이지로 호출을 하는바람에 내가 개발하는 페이지에서 popstate 이벤트가 발생하지 않았다.
(iframe 내부에서 여러페이지 이동 없이 하나의 단일페이지만 있는경우는 문제가 없다.)

(뒤로가기 수행 시) 이벤트가 발생해야 뭐라도 처리를 할텐데 이벤트가 발생하지 않아 스크립트로 컨트롤 자체를 할수가 없었다.



사용자의 액션이 있는경우 뒤로가기 수행이 가능한다.

(하지만 F5를 눌러서 새로고침 하는경우 여전히 이슈가 있다.)

GitHub 예제소스: https://github.com/1004lucifer/Test-JavaScript/tree/master/Vanilla/TroubleShooting/history-back-page-with-iframe

데모 페이지: https://1004lucifer.github.io/Test-JavaScript/Vanilla/TroubleShooting/history-back-page-with-iframe/outerFirst.html



여기에는 두가지 단점이 있다.


 1. (스크립트를 수행하기 위해) 사용자가 특정 버튼을 누르는것과 같이 어떠한 액션이 있어야 한다.
 2. iframe이 있는 컨텐츠 모습에서 F5 와 같이 새로고침을 하게되는경우 history 스택에 쌓인 내용이 없어지지 않아 history 스택에 중복 데이터가 쌓이게 된다.
    따라서 위 스크립트를 수행 시 이전에 쌓인 history 스택 때문에 정상적으로 동작하지 않는다.

1004lucifer

위와같은 단점이 있지만..
Angular / Vue / React 와 같은 SPA 사이트에서는 그나마 사용할 수 있는 가장 나은 방법이 아닐까 싶다.


2021년 5월 20일 목요일

[React] TypeError: Cannot read property 'apply' of underfined (Redux DevTools 미설치 이슈)

 


증상 및 문제


증상1
 - 개발모드에서만 해당 증상이 나타나며, npm build 후 빌드된 소스에서는 증상이 발생하지 않는다.


증상2
 - 내 PC 에서 프로젝트 셋팅 후 구동 시 문제없이 동작이 된다.
 - 동료 PC 에서 소스를 내려받아 구동 시 Chrome 브라우저에서 아래와 같이 보여진다.



1004lucifer


이유 및 해결방안

TypeError: Cannot read property 'apply' of underfined 라는 메시지는 꼭 여기서만 나타나는게 아니라 다른 곳에서도 나오겠지만..

현재의 상황에서는 코드에서 개발환경인경우 'redux-devtools-extension' 을 사용하도록 셋팅한 경우에 위와 같은 증상이 발생한다.





Redux DevTools 설치하면 정상적으로 보여지게 된다.

https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?utm_source=chrome-ntp-icon





2021년 5월 16일 일요일

[React] ERROR - readonly keyword (Parsing error: Unexpected token, expected ":")

 


문제

yarn create react-app typescript-readonly_keyword-error --template typescript

위 명령어로 Typescript 형식의 React 프로젝트를 생성 후

프로젝트 셋팅 중 아래와 같은 에러가 나면서 페이지가 뜨지 않는 문제가 발생했다.

(아마 readonly 키워드를 변수명으로 잘못 인지해서 발생하는 에러로 보여진다.)



Failed to compile.

src\App.tsx
  Line 6:12:  Parsing error: Unexpected token, expected ":"

  5 |
  6 | export interface IRootState {
> 7 |   readonly loadingBar: any;
    |            ^
  8 | }
  9 |
  10| function App() {




원인 및 해결방법

- 아마 같은 증상이지만 원인이 다를 수 있다. 나의 경우에는 아래와 같았다.


package.json 파일을 수정하다가 eslintConfig 항목을 빠트렸더니 위와 같은 오류가 발생했으며, create-react-app 으로 처음 만들었을 때와 같이 eslintConfig 항목을 넣어줬더니 문제가 없어졌다.

https://github.com/1004lucifer/Test-JavaScript/blob/20ae946813d16fd6327ce5c9fcf5caa34a38cd95/React/TroubleShooting/typescript-readonly_keyword-error/package_origin.json#L25


아래의 GitHub 프로젝트를 수행하여 이슈를 직접 확인해볼 수 있다.
 - https://github.com/1004lucifer/Test-JavaScript/tree/master/React/TroubleShooting/typescript-readonly_keyword-error



2021년 3월 16일 화요일

[IntelliJ] 톰캣 debug 모드로 기동 시 Address already in use: NET_Bind 이슈 해결방법

 


증상

 - (해당 포트가 어디에도 쓰이지는 않는것 같지만) 포트충돌이 난다고 톰캣이 기동되지 않는다.

 - HTTP, JMX 포트가 아닌 54397 과 같은 큰 숫자의 포트이다.



해결방법

1. Run/Debug Configurations
2. 해당 톰캣 선택
3. Startup/Connection 선택
4. Debug 선택
5. Port를 1씩 줄이거나 늘리면서 바꿔보면서 기동을 해본다.




=== 2021.08.19 내용 업데이트 ===

PS.

만일 위와같이 포트를 변경하면서 시도를 해봐도 해결이 되지 않을 때 winnat를 재기동 하면 된다.




참고
 - https://youtrack.jetbrains.com/issue/IDEA-226958
 - https://stackoverflow.com/questions/61344554/tomcat-debug-error-unable-to-open-debugger-port-127-0-0-163199-java-net-bin


[FCM] 푸시 발송 오류 원인 - Error getting access token for service account / Connection reset




증상

FCM Push 발송 시 아래와 같은 오류가 발생하면서 푸시발송이 정상적으로 되지 않았다.
(어쩔때는 정상적으로 되다가 안되다가 하는 증상)



원인

(나의 경우에는 코드에 문제가 없었지만)
회사의 네트워크에 보안설정에 의해 푸시 발송이 정상적으로 되지 않았다.
모바일 기기의 테더링으로 같은코드를 수행 시 정상적으로 푸시발송이 되는것을 확인 할 수 있었다.





com.google.firebase.messaging.FirebaseMessagingException: Unknown error while making a remote service call: Error getting access token for service account: java.net.SocketException: Connection reset

at com.google.firebase.messaging.FirebaseMessagingException.withMessagingErrorCode(FirebaseMessagingException.java:47)
at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingErrorHandler.createException(FirebaseMessagingClientImpl.java:293)
at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingErrorHandler.createException(FirebaseMessagingClientImpl.java:282)
at com.google.firebase.internal.AbstractHttpErrorHandler.handleIOException(AbstractHttpErrorHandler.java:63)
at com.google.firebase.internal.ErrorHandlingHttpClient.createHttpRequest(ErrorHandlingHttpClient.java:141)
at com.google.firebase.internal.ErrorHandlingHttpClient.send(ErrorHandlingHttpClient.java:92)
at com.google.firebase.internal.ErrorHandlingHttpClient.sendAndParse(ErrorHandlingHttpClient.java:72)
at com.google.firebase.messaging.FirebaseMessagingClientImpl.sendSingleRequest(FirebaseMessagingClientImpl.java:127)
at com.google.firebase.messaging.FirebaseMessagingClientImpl.send(FirebaseMessagingClientImpl.java:113)
at com.google.firebase.messaging.FirebaseMessaging$1.execute(FirebaseMessaging.java:135)
at com.google.firebase.messaging.FirebaseMessaging$1.execute(FirebaseMessaging.java:132)
at com.google.firebase.internal.CallableOperation.call(CallableOperation.java:36)
at com.google.firebase.messaging.FirebaseMessaging.send(FirebaseMessaging.java:102)
at com.google.firebase.messaging.FirebaseMessaging.send(FirebaseMessaging.java:86)
at kr.co._1004lucifer.util.FcmUtil.send(FcmUtil.java:47)
at kr.co._1004lucifer.util.FcmUtilTest.send(FcmUtilTest.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: java.io.IOException: Error getting access token for service account: java.net.SocketException: Connection reset
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:444)
at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:157)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:145)
at com.google.auth.oauth2.ServiceAccountCredentials.getRequestMetadata(ServiceAccountCredentials.java:603)
at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:91)
at com.google.firebase.internal.FirebaseRequestInitializer.initialize(FirebaseRequestInitializer.java:55)
at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:88)
at com.google.firebase.internal.HttpRequestInfo.newHttpRequest(HttpRequestInfo.java:105)
at com.google.firebase.internal.ErrorHandlingHttpClient.createHttpRequest(ErrorHandlingHttpClient.java:137)
... 39 more
Caused by: javax.net.ssl.SSLException: java.net.SocketException: Connection reset
at sun.security.ssl.Alert.createSSLException(Alert.java:127)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:353)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:296)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:291)
at sun.security.ssl.SSLTransport.decode(SSLTransport.java:141)
at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1279)
at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1188)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:401)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:587)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1340)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1315)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:264)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:113)
at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:84)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1012)
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:441)
... 47 more
Suppressed: java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:83)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:384)
... 63 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:475)
at sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:469)
at sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:159)
at sun.security.ssl.SSLTransport.decode(SSLTransport.java:110)
... 60 more



2020년 12월 16일 수요일

[IntelliJ] svn: E170013, E230001 - SVN주소 HTTPS 관련 이슈 해결방법

 



증상

IntelliJ 에서 SVN 저장소 추가 시 아래와 같이 보여지며 소스 내용이 보여지지 않았다.



svn: E170013: Unable to connect to a repository at URL 'https://SVN주소'
svn: E230001: Server SSL certificate verification failed: certificate has expired, certificate issued for a different hostname, issuer is not trusted



해결방법

Settings 에서 svn으로 검색 후 아래의 화면과 같이 체크를 한다.



1004lucifer

그리고 SVN저장소 부분을 새로고침 하면 아래와 같은 모습이 나오는데 Accept 를 눌러준다.



SVN계정을 입력 후 OK를 눌러주면 이후에는 정상적으로 이용이 가능하다.



2020년 12월 7일 월요일

[Redis] Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system 에러 (bgsave)

 



Linux 서버에 Redis를 설치 후 정상적으로 작동되는것을 확인하고 나중에 다시 사용하려 하니 정상적으로 사용을 할 수가 없었다.


문제

사용하려 할 시 아래와 같은 에러로그가 보여졌다.


set testkey testValue (error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
1004lucifer



서버의 Redis로그를 확인해보니 아래와 같았다.


21982:C 26 Nov 07:55:15.563 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
21982:C 26 Nov 07:55:15.563 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=21982, just started
21982:C 26 Nov 07:55:15.563 # Configuration loaded
                _._     
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 4.0.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._ 
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 22007
  `-._    `-._  `-./  _.-'    _.-' 
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-' 
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-' 
      `-._    `-.__.-'    _.-'
          `-._        _.-'    
              `-.__.-'        
1004lucifer
22007:M 26 Nov 07:55:15.568 # Server initialized
22007:M 26 Nov 07:55:15.568 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
22007:M 26 Nov 07:55:15.568 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
22007:M 26 Nov 07:55:15.569 * DB loaded from disk: 0.002 seconds
22007:M 26 Nov 07:55:15.570 * Ready to accept connections
22007:M 26 Nov 09:46:12.033 * DB saved on disk
22007:M 26 Nov 09:46:12.050 * DB saved on disk
22007:M 26 Nov 09:46:12.104 * DB saved on disk
22007:M 26 Nov 09:46:12.123 * DB saved on disk
22007:M 26 Nov 09:46:12.146 * DB saved on disk
22007:M 26 Nov 09:46:12.184 * DB saved on disk
22007:M 26 Nov 09:46:12.197 * DB saved on disk
22007:M 26 Nov 09:46:12.270 * DB saved on disk
22007:M 26 Nov 09:46:12.278 * DB saved on disk
22007:M 26 Nov 09:46:12.312 * DB saved on disk
22007:M 26 Nov 09:46:12.362 * DB saved on disk
22007:M 26 Nov 09:46:12.394 * DB saved on disk
22007:M 26 Nov 09:46:12.402 * DB saved on disk
22007:M 26 Nov 09:46:12.484 * DB saved on disk
22007:M 26 Nov 09:46:12.660 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.667 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.712 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.722 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.755 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.785 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.794 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.856 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.892 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:12.935 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.001 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.064 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.065 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.157 # Failed opening the RDB file backup.db (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.301 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.303 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.443 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.447 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.565 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.657 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system 1004lucifer
22007:M 26 Nov 09:46:13.745 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.839 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.839 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:13.917 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:14.046 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:46:14.141 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:13.079 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:51:13.080 * Background saving started by pid 22345
22345:C 26 Nov 09:51:13.080 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:13.180 # Background saving error
22007:M 26 Nov 09:51:19.090 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:51:19.090 * Background saving started by pid 22346
22346:C 26 Nov 09:51:19.090 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:19.190 # Background saving error
22007:M 26 Nov 09:51:25.100 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:51:25.102 * Background saving started by pid 22347
22347:C 26 Nov 09:51:25.102 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:25.202 # Background saving error
22007:M 26 Nov 09:51:31.012 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:51:31.012 * Background saving started by pid 22350
22350:C 26 Nov 09:51:31.012 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:31.112 # Background saving error
22007:M 26 Nov 09:51:37.021 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:51:37.021 * Background saving started by pid 22351
22351:C 26 Nov 09:51:37.022 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:37.122 # Background saving error
22007:M 26 Nov 09:51:43.031 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:51:43.032 * Background saving started by pid 22352
22352:C 26 Nov 09:51:43.032 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:43.132 # Background saving error
22007:M 26 Nov 09:51:49.041 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:51:49.041 * Background saving started by pid 22353
22353:C 26 Nov 09:51:49.041 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:49.141 # Background saving error
22007:M 26 Nov 09:51:55.050 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:51:55.050 * Background saving started by pid 22354
22354:C 26 Nov 09:51:55.051 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:51:55.151 # Background saving error
22007:M 26 Nov 09:52:01.061 * 10 changes in 300 seconds. Saving...
22007:M 26 Nov 09:52:01.061 * Background saving started by pid 22357
22357:C 26 Nov 09:52:01.061 # Failed opening the RDB file root (in server root dir /var/spool/cron) for saving: Read-only file system
22007:M 26 Nov 09:52:01.161 # Background saving error

 ... (위 에러가 계속 있음)




원인 및 해결방법

Redis 서버에 패스워드를 지정하지 않았고 기본포트로 되어있다 보니 누구나 접근이 가능했다.

스택오버플로우에서 외부 공격으로 인해 그럴 수 있으니 방화벽 설정을 해두라는 이야기를 듣고 사용할 곳의 IP를 제외하고는 다른곳에서 접속할 수 없게 했더니 더 이상 문제가 발생하지 않았다.



참고
 - https://stackoverflow.com/questions/41887280/redis-config-dir-periodically-modified-to-var-spool-cron-with-failed-opening