<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>lena.dev</title>
        <link>https://velog.io/</link>
        <description>꾸준한게 장점</description>
        <lastBuildDate>Wed, 16 Nov 2022 06:08:14 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <copyright>Copyright (C) 2019. lena.dev. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/lena_dev" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[Heroku 배포 중 Boot timeout 에러]]></title>
            <link>https://velog.io/@lena_dev/Heroku-%EB%B0%B0%ED%8F%AC-%EC%A4%91-Boot-timeout-%EC%97%90%EB%9F%AC</link>
            <guid>https://velog.io/@lena_dev/Heroku-%EB%B0%B0%ED%8F%AC-%EC%A4%91-Boot-timeout-%EC%97%90%EB%9F%AC</guid>
            <pubDate>Wed, 16 Nov 2022 06:08:14 GMT</pubDate>
            <description><![CDATA[<p>heroku 로 디스코드봇을 배포하던 도중</p>
<p><code>Error R10 (Boot timeout) -&gt; Web process failed to bind to $PORT within 60 seconds of launch</code></p>
<p>위와 같은 에러를 만났다.
에러 코드의 설명 그대로 port 에 binding 하는것을 실패했다는 에러이다.
내 코드를 보니 <code>app.listen</code> 을 따로 해주고 있지 않았다. 자동으로 random port 에 바인딩 해서 서버를 실행하는 줄 알았더니 아니었던 모양이다. 따라서 아래와 같이 port 를 지정해주고, <code>app.listen</code> 으로 서버를 실행해줬더니 해결되었다.</p>
<pre><code class="language-jsx">const PORT = process.env.PORT || 3000;
app.listen(PORT, () =&gt; {
  console.log(`Our app is running on port ${PORT}`);
});</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[discord js 사용 시 content 가 계속 빈 값으로 나올때]]></title>
            <link>https://velog.io/@lena_dev/discord-js-content-%EB%B9%88-%EA%B0%92%EC%9C%BC%EB%A1%9C-%EB%82%98%EC%98%AC%EB%95%8C</link>
            <guid>https://velog.io/@lena_dev/discord-js-content-%EB%B9%88-%EA%B0%92%EC%9C%BC%EB%A1%9C-%EB%82%98%EC%98%AC%EB%95%8C</guid>
            <pubDate>Wed, 09 Nov 2022 07:16:44 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/lena_dev/post/5c73120d-bd98-4bd1-94f0-84cada5ba075/image.png" alt=""></p>
<p>메시지의 content 를 읽으려고 불러와도 계속 빈 스트링으로 나오는 에러(?)가 있었다. 원인은 에러라기 보다는 디스코드 developer portal 의 설정 문제였다. client instance 의 intents 키에 <code>GatewayIntentBits.MessageContent,</code> 를 추가해주거나, 직접 포탈로 가서 해당 설정을 켜두면 된다.</p>
<hr>
<p>ref) <a href="https://stackoverflow.com/questions/73036854/message-content-doesnt-have-any-value-in-discord-js-v14">https://stackoverflow.com/questions/73036854/message-content-doesnt-have-any-value-in-discord-js-v14</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[SignatureDoesNotMatch]]></title>
            <link>https://velog.io/@lena_dev/SignatureDoesNotMatch</link>
            <guid>https://velog.io/@lena_dev/SignatureDoesNotMatch</guid>
            <pubDate>Wed, 28 Sep 2022 02:50:19 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/lena_dev/post/96b98449-132d-47de-8b39-033567cd9329/image.png" alt=""></p>
<p>s3 에서 미리 서명된 url(presigned url) 을 이용하여 콘텐츠 업로드 시 위 에러가 뜨는 경우가 있다.</p>
<p>에러 메시지를 읽어보면 The request signature we calculated does not match the signature you provided. <strong>Check your key and signing method.</strong></p>
<p>그렇다면 호출하고 있는 method 를 체크해보자.</p>
<p><code>putObject</code> 로 호출하고 있는 presigned url 을 get method 로 호출하고 있어서 생기는 문제였다. put method 로 변경하여 호출해주자 해결되었다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[eb create 시 NotAuthorizedError]]></title>
            <link>https://velog.io/@lena_dev/eb-create-notauthorizederror</link>
            <guid>https://velog.io/@lena_dev/eb-create-notauthorizederror</guid>
            <pubDate>Sun, 28 Aug 2022 14:00:49 GMT</pubDate>
            <description><![CDATA[<p>Elastic beanstalk 배포를 위해 eb create 명령어 입력 시</p>
<pre><code>MacBook-pro project % eb init 

...

ERROR: NotAuthorizedError - Operation Denied. Access Denied</code></pre><p><img src="https://velog.velcdn.com/images/lena_dev/post/d16d69e0-6a26-49cd-99e5-9fe4522d5b63/image.png" alt=""></p>
<p>위 에러가 발생하는 경우, aws configure 혹은 eb init 시 설정해둔 aws profile 의 IAM 권한을 확인해야 한다.
나의 경우는 <code>AmazonS3FullAccess</code> 권한이 없어 발생한 에러였다.</p>
<p>기본적으로
AdministratorAccess-AWSElasticBeanstalk
AmazonEC2FullAccess
AWSCodeDeployFullAccess
AWSCodeDeployRole
AmazonS3FullAccess
위 권한들이 있으면 create 시 아무 문제가 없는거 같다.</p>
<hr>
<p>+기존의 AWSElasticBeanstalkFullAccess 권한이 AdministratorAccess-AWSElasticBeanstalk 권한으로 변경되었다.
ref) <a href="https://stackoverflow.com/questions/67485957/awselasticbeanstalkfullaccess-provides-full-access-equivalent">https://stackoverflow.com/questions/67485957/awselasticbeanstalkfullaccess-provides-full-access-equivalent</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[serverless 에서 .env 파일 인식 하지 못할 때]]></title>
            <link>https://velog.io/@lena_dev/serverlessdotenv</link>
            <guid>https://velog.io/@lena_dev/serverlessdotenv</guid>
            <pubDate>Sun, 14 Aug 2022 06:19:31 GMT</pubDate>
            <description><![CDATA[<p>serverless dotenv plugin 을 설치해준다.</p>
<pre><code class="language-bash">npm i -D serverless-dotenv-plugin

yarn add serverless-dotenv-plugin</code></pre>
<p>serverless.yaml 파일에 위 plugin 을 추가해준다.</p>
<pre><code class="language-yaml">service:
  name: my-service
plugins:
  - serverless-dotenv-plugin
  ...</code></pre>
<p>이러면 이제 process.env 를 이용하여 .env 파일에 선언해 둔 환경설정을 불러올 수 있게 된다.</p>
<hr>
<p>ref
<a href="https://www.serverless.com/plugins/serverless-dotenv-plugin">https://www.serverless.com/plugins/serverless-dotenv-plugin</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA["/tmp/.s.PGSQL.5432" failed]]></title>
            <link>https://velog.io/@lena_dev/tmp.s.PGSQL.5432-failed</link>
            <guid>https://velog.io/@lena_dev/tmp.s.PGSQL.5432-failed</guid>
            <pubDate>Tue, 24 May 2022 01:29:41 GMT</pubDate>
            <description><![CDATA[<pre><code>error: connection to server on socket &quot;/tmp/.s.PGSQL.5432&quot; failed: No such file or directory
    Is the server running locally and accepting connections on that socket?</code></pre><p><code>psql</code> 명령어로 postgresql 을 실행하려다 위와 같은 에러가 뜨면서 실행이 되지 않았다. 이런 경우,</p>
<pre><code>iMac ~ % rm /opt/homebrew/var/postgres/postmaster.pid
iMac ~ % brew services restart postgresql            
Stopping `postgresql`... (might take a while)
==&gt; Successfully stopped `postgresql` (label: homebrew.mxcl.postgresql)
==&gt; Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
iMac ~ % psql postgres</code></pre><p><code>brew services restart postgresql</code> 후 다시 <code>psql</code> 을 실행하면 제대로 작동한다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[serverless token invalid error ]]></title>
            <link>https://velog.io/@lena_dev/serverlessinvalidtoken</link>
            <guid>https://velog.io/@lena_dev/serverlessinvalidtoken</guid>
            <pubDate>Tue, 26 Apr 2022 05:59:43 GMT</pubDate>
            <description><![CDATA[<p>serverless 배포 도중</p>
<pre><code>The security token included in the request is invalid.</code></pre><p>  <img src="https://velog.velcdn.com/images/lena_dev/post/0451c8f4-12f2-43c0-a355-12b7a9356e93/image.png" alt=""></p>
<p>에러 발생시, aws configure 와 aws credentials 정보가 같은지 확인해야 한다. </p>
]]></description>
        </item>
        <item>
            <title><![CDATA[clientId is configured for secret but secret was not received]]></title>
            <link>https://velog.io/@lena_dev/clientId-is-configured-for-secret-but-secret-was-not-received</link>
            <guid>https://velog.io/@lena_dev/clientId-is-configured-for-secret-but-secret-was-not-received</guid>
            <pubDate>Sun, 10 Apr 2022 13:40:10 GMT</pubDate>
            <description><![CDATA[<p>AWS cognito 를 사용하다 보면 간혹</p>
<pre><code>AWS cognito Client &#39;clientId&#39; is configured for secret but secret was not received ...</code></pre><p>라는 이름의 에러를 만날때가 있다.</p>
<p><img src="https://velog.velcdn.com/images/lena_dev/post/38ab4190-76bc-4aab-9a2c-e5af80789776/image.png" alt=""></p>
<p>Cognito 에서 User pool 을 생성할 때 App client 부분의 generate client secret (빨간 블럭 부분) 을 체크하면 secret 키를 generate 하여 넣어주어야 하는데, 체크한 후 secret key를 넣어주지 않아서 생기는 문제이다.
한번 체크되어 생성한 App client 는 체크 수정이 되지 않는다. 따라서 App client 를 새로 만들고 만들 때 해당 체크박스를 해제하면 된다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[cannot read tsconfig.json]]></title>
            <link>https://velog.io/@lena_dev/cannot-read-tsconfig.json</link>
            <guid>https://velog.io/@lena_dev/cannot-read-tsconfig.json</guid>
            <pubDate>Fri, 08 Apr 2022 02:09:55 GMT</pubDate>
            <description><![CDATA[<p>typescript parsing error</p>
<p>eslint 경로 설정 문제이다.
parser Oprions 에 <code>tsconfigRootDir: __dirname</code> 을 추가하면 된다.</p>
<pre><code class="language-js">// /.eslintrc.js

...
parserOptions: {
    project: &quot;./tsconfig.json&quot;,
    tsconfigRootDir: __dirname,
    sourceType: &quot;module&quot;,
  },
...
</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[Node 17 'ERR_PACKAGE_PATH_NOT_EXPORTED']]></title>
            <link>https://velog.io/@lena_dev/Node-17-ERRPACKAGEPATHNOTEXPORTED</link>
            <guid>https://velog.io/@lena_dev/Node-17-ERRPACKAGEPATHNOTEXPORTED</guid>
            <pubDate>Wed, 06 Apr 2022 01:20:33 GMT</pubDate>
            <description><![CDATA[<pre><code>iMac project% yarn start  
yarn run v1.22.17
$ react-scripts start
node:internal/modules/cjs/loader:488
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath &#39;./lib/tokenize&#39; is not defined by &quot;exports&quot; in /Users/iMac/project/node_modules/postcss-safe-parser/node_modules/postcss/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:703:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.&lt;anonymous&gt; (/Users/iMac/project/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
  code: &#39;ERR_PACKAGE_PATH_NOT_EXPORTED&#39;
}

Node.js v17.4.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</code></pre><p><a href="https://github.com/facebook/create-react-app/issues/11579">CRA git issue</a> 에서도 해결 방법을 찾을 수 있었다. node version 을 16으로 낮추는 방법과 <code>yarn upgrade</code> 를 하는 방법이 있다. </p>
<p>나는 node version 을 굳이 다운그레이드 하고 싶지 않아 <code>yarn upgrade</code> 를 통해 문제를 해결했다. 이후에도 해당 에러가 계속 발생한다면 yarn_lock 파일을 삭제하고 다시 <code>yarn install</code> 해주면 된다. 
위의 방법으로도 해결되지 않을 경우에는 node_module 과 yarn_lock 파일을 함께 삭제하고 다시 <code>yarn install</code> 하면 해결된다.</p>
<p>npm 도 마찬가지로 upgrade 해주면 된다고 한다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[brew doctor symlink error]]></title>
            <link>https://velog.io/@lena_dev/brew-doctor-symlink-error</link>
            <guid>https://velog.io/@lena_dev/brew-doctor-symlink-error</guid>
            <pubDate>Tue, 05 Apr 2022 13:13:29 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/cloudflare/lena_dev/8a375fb8-5727-41a7-bec6-797d643d239e/image.png" alt=""></p>
<p>최근 맥북을 초기화했는데, 다시 PostgreSQL 을 설치하려고 <code>brew update</code> 및 <code>brew doctor</code> 실행하는 도중 에러가 발견되었다.</p>
<p>참고로 <code>brew doctor</code> 명령어는 home brew 의 자체 진단 도구로, 모든 것이 제대로 작동하는지 확인한 다음 문제를 보고하고 해결방법을 알려준다.</p>
<p>발생한 에러 메시지는 아래 두 개이다.</p>
<ul>
<li><p>Warning: &quot;config&quot; scripts exist outside your system or Homebrew directories.</p>
</li>
<li><p>Warning: You have unlinked kegs in your Cellar.</p>
</li>
</ul>
<pre><code>mac@MacBookPro ~ % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don&#39;t worry or file an issue; just ignore this. Thanks!

Warning: &quot;config&quot; scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following &quot;config&quot; scripts:
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5m-config
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5-config
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3-config

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python@3.9</code></pre><h3 id="fix-you-have-unlinked-kegs-in-your-cellar-error">fix You have unlinked kegs in your Cellar error</h3>
<p>일단 아래의 <code>Warning: You have unlinked kegs in your Cellar.</code> 에러부터 해결해보자.</p>
<p>에러 메시지를 잘 읽어보면, <code>Run brew link on these: python@3.9</code> 를 하라고 친절하게 알려주고 있다. <code>brew link</code> 는 symlinks를 생성하는 명령어인데, 아마도 python 3.9 version 의 경로 참조가 잘못된 모양이다.</p>
<pre><code>mac@MacBookPro ~ % brew link python@3.9</code></pre><p>시도하니 아래와 같은 에러가 발생했다.</p>
<pre><code>mac@MacBookPro ~ % brew link python@3.9
Linking /usr/local/Cellar/python@3.9/3.9.12... 
Error: Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm &#39;/usr/local/bin/2to3&#39;

To force the link and overwrite all conflicting files:
  brew link --overwrite python@3.9

To list all files that would be deleted:
  brew link --overwrite --dry-run python@3.9</code></pre><p><code>/usr/local/bin/2to3</code> 에 이미 있어 symlink를 생성할 수 없으니 그것을 지우고 overwrtie 하라고 한다. 시키는대로 진행한다.</p>
<pre><code>mac@MacBookPro ~ % rm &#39;/usr/local/bin/2to3&#39;
mac@MacBookPro ~ % brew link --overwrite python@3.9
Linking /usr/local/Cellar/python@3.9/3.9.12... 24 symlinks created.</code></pre><p><code>brew doctor</code> 를 실행하면 이제 <code>Warning: You have unlinked kegs in your Cellar.</code> 에러는 사라지고 하나의 에러만이 남았음을 확인할 수 있다.</p>
<pre><code>mac@MacBookPro ~ % brew doctor        
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don&#39;t worry or file an issue; just ignore this. Thanks!

Warning: &quot;config&quot; scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following &quot;config&quot; scripts:
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5m-config
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5-config
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3-config</code></pre><h3 id="fix-config-scripts-exist-outside-your-system-or-homebrew-directories-error">fix &quot;config&quot; scripts exist outside your system or Homebrew directories error</h3>
<p><code>Warning: &quot;config&quot; scripts exist outside your system or Homebrew directories.</code> 에러의 해결책은 <a href="https://stackoverflow.com/questions/60691090/received-error-after-entering-brew-doctor">stackoverflow</a> 에서 도움 받았다.</p>
<p>먼저 config scripts 가 있는 path directory 를 전부 지운다.</p>
<pre><code>mac@MacBookPro ~ % rm /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5m-config
mac@MacBookPro ~ % rm /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5-config
mac@MacBookPro ~ % rm /Library/Frameworks/Python.framework/Versions/3.5/bin/python3-config</code></pre><p>그리고 <code>brew doctor</code> 를 다시 실행한다.</p>
<pre><code>mac@MacBookPro ~ % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don&#39;t worry or file an issue; just ignore this. Thanks!

Warning: Broken symlinks were found. Remove them with `brew cleanup`:
  /usr/local/bin/python3.5-config
  /usr/local/bin/python3.5m-config</code></pre><p>그러면 이제 <code>brew cleanup</code> 을 통해 Broken symlinks를 cleanup 시키라고 알려준다. 명령어를 통해 cleanup 한 후, <code>brew doctor</code> 를 다시 실행하면</p>
<pre><code>mac@MacBookPro ~ % brew doctor 
Your system is ready to brew.</code></pre><p>짜잔! 해결된다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[dacapo]]></title>
            <link>https://velog.io/@lena_dev/dacapo</link>
            <guid>https://velog.io/@lena_dev/dacapo</guid>
            <pubDate>Tue, 05 Apr 2022 12:50:24 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/cloudflare/lena_dev/d7646544-8840-46ac-b7d1-fdff20f5c485/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202022-04-05%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%209.38.55.png" alt=""></p>
<p>dacapo 를 만나면 처음으로 돌아가 다시 연주하게 된다.</p>
<p>개발 공부를 시작하면서 약 1년간 velog 를 이용하다가 티스토리로 이주했었는데, 티스토리가 불편해서 다시 이주해왔다. 처음으로 돌아온 느낌과 잘 어울리는거 같아 냉큼 제목에 가져다 붙였다.</p>
<p>블로그를 쓰려는 이유는 기억을 보조하기 위해서이다. 기록하는걸 좋아하기도 하지만, 어떤 것을 공부했는지 어떤 에러를 만났고 어떻게 해결했는지 또 거기서 무엇을 배웠는지 기록해두면 나름 도움이 되더라. 그게 나 말고 다른 누군가에게도 도움이 된다면 더 좋고.</p>
<p>지난 블로그들은 그저 배운것을 옮기는 것에 급급했다면 이번 블로그는 조금 더 양질의 글로 채우고 싶다.</p>
<p>일이 바빠 업로드가 조금 느리더라도 차근차근 꾸준히 쌓아갈 수 있기를 바라며.
인트로 없이는 글을 못 쓰는 버릇때문에 계속 비공개글만 쌓인채 미루고 미뤄질까 두려워 던져두는 글.</p>
]]></description>
        </item>
    </channel>
</rss>