Github "Problems parsing JSON", Creating Repository from console on Windows 10 - github

I was trying to create a new Repository from CMD on Windows 10 Pro, following this answer:
https://stackoverflow.com/a/10325316
My First Try
C:\Users\joseluisbz>curl -u joseluisbz https://api.github.com/user/repos -d '{"name":"BasicOperations"}'
Enter host password for user 'joseluisbz':
{
"message": "Problems parsing JSON",
"documentation_url": "https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user"
}
The second try
C:\Users\joseluisbz>curl -u joseluisbz https://api.github.com/user/repos -d \'{"name":"BasicOperations"}\'
Enter host password for user 'joseluisbz':
{
"message": "Problems parsing JSON",
"documentation_url": "https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user"
}
C:\Users\joseluisbz>
From macOS works perfectly.
joseluisbz#Joses-MacBook-Air Java % curl -u joseluisbz https://api.github.com/user/repos -d '{"name":"BasicOperations"}'
Enter host password for user 'joseluisbz':
{
"id": 293512428,
"node_id": "I CHANGED THIS HASH",
"name": "BasicOperations",
"full_name": "joseluisbz/BasicOperations",
"private": false,
"owner": {
"login": "joseluisbz",
"id": 16026347,
"node_id": "I CHANGED THIS HASH",
"avatar_url": "https://avatars2.githubusercontent.com/u/16026347?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/joseluisbz",
"html_url": "https://github.com/joseluisbz",
"followers_url": "https://api.github.com/users/joseluisbz/followers",
"following_url": "https://api.github.com/users/joseluisbz/following{/other_user}",
"gists_url": "https://api.github.com/users/joseluisbz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/joseluisbz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joseluisbz/subscriptions",
"organizations_url": "https://api.github.com/users/joseluisbz/orgs",
"repos_url": "https://api.github.com/users/joseluisbz/repos",
"events_url": "https://api.github.com/users/joseluisbz/events{/privacy}",
"received_events_url": "https://api.github.com/users/joseluisbz/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/joseluisbz/BasicOperations",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/joseluisbz/BasicOperations",
"forks_url": "https://api.github.com/repos/joseluisbz/BasicOperations/forks",
"keys_url": "https://api.github.com/repos/joseluisbz/BasicOperations/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/joseluisbz/BasicOperations/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/joseluisbz/BasicOperations/teams",
"hooks_url": "https://api.github.com/repos/joseluisbz/BasicOperations/hooks",
"issue_events_url": "https://api.github.com/repos/joseluisbz/BasicOperations/issues/events{/number}",
"events_url": "https://api.github.com/repos/joseluisbz/BasicOperations/events",
"assignees_url": "https://api.github.com/repos/joseluisbz/BasicOperations/assignees{/user}",
"branches_url": "https://api.github.com/repos/joseluisbz/BasicOperations/branches{/branch}",
"tags_url": "https://api.github.com/repos/joseluisbz/BasicOperations/tags",
"blobs_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/joseluisbz/BasicOperations/statuses/{sha}",
"languages_url": "https://api.github.com/repos/joseluisbz/BasicOperations/languages",
"stargazers_url": "https://api.github.com/repos/joseluisbz/BasicOperations/stargazers",
"contributors_url": "https://api.github.com/repos/joseluisbz/BasicOperations/contributors",
"subscribers_url": "https://api.github.com/repos/joseluisbz/BasicOperations/subscribers",
"subscription_url": "https://api.github.com/repos/joseluisbz/BasicOperations/subscription",
"commits_url": "https://api.github.com/repos/joseluisbz/BasicOperations/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/joseluisbz/BasicOperations/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/joseluisbz/BasicOperations/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/joseluisbz/BasicOperations/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/joseluisbz/BasicOperations/contents/{+path}",
"compare_url": "https://api.github.com/repos/joseluisbz/BasicOperations/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/joseluisbz/BasicOperations/merges",
"archive_url": "https://api.github.com/repos/joseluisbz/BasicOperations/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/joseluisbz/BasicOperations/downloads",
"issues_url": "https://api.github.com/repos/joseluisbz/BasicOperations/issues{/number}",
"pulls_url": "https://api.github.com/repos/joseluisbz/BasicOperations/pulls{/number}",
"milestones_url": "https://api.github.com/repos/joseluisbz/BasicOperations/milestones{/number}",
"notifications_url": "https://api.github.com/repos/joseluisbz/BasicOperations/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/joseluisbz/BasicOperations/labels{/name}",
"releases_url": "https://api.github.com/repos/joseluisbz/BasicOperations/releases{/id}",
"deployments_url": "https://api.github.com/repos/joseluisbz/BasicOperations/deployments",
"created_at": "2020-09-07T11:45:04Z",
"updated_at": "2020-09-07T11:45:04Z",
"pushed_at": "2020-09-07T11:45:06Z",
"git_url": "git://github.com/joseluisbz/BasicOperations.git",
"ssh_url": "git#github.com:joseluisbz/BasicOperations.git",
"clone_url": "https://github.com/joseluisbz/BasicOperations.git",
"svn_url": "https://github.com/joseluisbz/BasicOperations",
"homepage": null,
"size": 0,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": null,
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"allow_squash_merge": true,
"allow_merge_commit": true,
"allow_rebase_merge": true,
"delete_branch_on_merge": false,
"network_count": 0,
"subscribers_count": 1
}
joseluisbz#Joses-MacBook-Air Java %
EDIT 1:
C:\Users\joseluisbz>curl --version
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: 2017-11-14, security patched: 2019-11-05
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
C:\Users\joseluisbz>
I was testing too with https://curl.haxx.se/windows/dl-7.72.0_4/curl-7.72.0_4-win64-mingw.zip with the same problems
D:\Programs\curl-7.72.0-win64-mingw\bin
λ curl.exe --version
curl 7.72.0 (x86_64-pc-win32) libcurl/7.72.0 OpenSSL/1.1.1g (Schannel) zlib/1.2.11 brotli/1.0.9 zstd/1.4.5 WinIDN libssh2/1.9.0 nghttp2/1.41.0
Release-Date: 2020-08-19
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP Unicode UnixSockets brotli libz zstd
D:\Programs\curl-7.72.0-win64-mingw\bin
What would be the problem?
Thanks in advance.

It is working changing the Trailing BackSlash
curl -u joseluisbz https://api.github.com/user/repos -d "{\"name\":\"BasicOperations3\"}"
Example
i:\joseluisbz\NetBeansProjects\BasicOperations (master -> origin)
λ curl -u joseluisbz https://api.github.com/user/repos -d "{\"name\":\"BasicOperations3\"}"
Enter host password for user 'joseluisbz':
{
"id": 293578020,
"node_id": "CHANCED HASH",
"name": "BasicOperations3",
"full_name": "joseluisbz/BasicOperations3",
"private": false,
"owner": {
"login": "joseluisbz",
"id": 16026347,
"node_id": "CHANCED HASH",
"avatar_url": "https://avatars2.githubusercontent.com/u/16026347?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/joseluisbz",
"html_url": "https://github.com/joseluisbz",
"followers_url": "https://api.github.com/users/joseluisbz/followers",
"following_url": "https://api.github.com/users/joseluisbz/following{/other_user}",
"gists_url": "https://api.github.com/users/joseluisbz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/joseluisbz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joseluisbz/subscriptions",
"organizations_url": "https://api.github.com/users/joseluisbz/orgs",
"repos_url": "https://api.github.com/users/joseluisbz/repos",
"events_url": "https://api.github.com/users/joseluisbz/events{/privacy}",
"received_events_url": "https://api.github.com/users/joseluisbz/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/joseluisbz/BasicOperations3",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/joseluisbz/BasicOperations3",
"forks_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/forks",
"keys_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/teams",
"hooks_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/hooks",
"issue_events_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/issues/events{/number}",
"events_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/events",
"assignees_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/assignees{/user}",
"branches_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/branches{/branch}",
"tags_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/tags",
"blobs_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/statuses/{sha}",
"languages_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/languages",
"stargazers_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/stargazers",
"contributors_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/contributors",
"subscribers_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/subscribers",
"subscription_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/subscription",
"commits_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/contents/{+path}",
"compare_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/merges",
"archive_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/downloads",
"issues_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/issues{/number}",
"pulls_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/pulls{/number}",
"milestones_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/milestones{/number}",
"notifications_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/labels{/name}",
"releases_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/releases{/id}",
"deployments_url": "https://api.github.com/repos/joseluisbz/BasicOperations3/deployments",
"created_at": "2020-09-07T16:26:45Z",
"updated_at": "2020-09-07T16:26:45Z",
"pushed_at": "2020-09-07T16:26:46Z",
"git_url": "git://github.com/joseluisbz/BasicOperations3.git",
"ssh_url": "git#github.com:joseluisbz/BasicOperations3.git",
"clone_url": "https://github.com/joseluisbz/BasicOperations3.git",
"svn_url": "https://github.com/joseluisbz/BasicOperations3",
"homepage": null,
"size": 0,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": null,
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"permissions": {
"admin": true,
"push": true,
"pull": true
},
"allow_squash_merge": true,
"allow_merge_commit": true,
"allow_rebase_merge": true,
"delete_branch_on_merge": false,
"network_count": 0,
"subscribers_count": 1
}
i:\joseluisbz\NetBeansProjects\BasicOperations (master -> origin)

Related

Resolving a GitHub Issue from a Project Card via the RESTful SDK

I'm using octokit (https://octokit.github.io/rest.js/v18#projects-list-cards) to interact with my Project and Issues in my repo. I have the project_cards in a list, but I'd like to make some changes to the labels on the issue when I move from column to column.
As near as I can tell (https://docs.github.com/en/rest/reference/projects#list-project-cards), the only way to get the issue number is to manually parse the content_url field:
[
{
"url": "https://api.github.com/projects/columns/cards/1478",
"id": 1478,
"node_id": "MDExOlByb2plY3RDYXJkMTQ3OA==",
"note": "Add payload for delete Project column",
"creator": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-09-05T14:21:06Z",
"updated_at": "2016-09-05T14:20:22Z",
"archived": false,
"column_url": "https://api.github.com/projects/columns/367",
"content_url": "https://api.github.com/repos/api-playground/projects-test/issues/3",
"project_url": "https://api.github.com/projects/120"
}
]
This seems pretty surprising to me, am i missing something? I'm just looking to figure out what the underlying issue number is so that I can do some manipulation of the labels.

Centos8 podman exiting all containers (139)

Any image I would try to run the behavior is always the same "Exited (139)"
OS: Centos 8 with podman running inside an Azure VM. The Centos image is the one provided by Azure when creating a VM.
VM: Azure B2S Gen 2 | 2vCPU(s) | 4 GiB RAM | 8 GiB SSD
I paste below the exact extract from the terminal:
pull
$ podman pull fedora
Trying to pull registry.access.redhat.com/fedora...
name unknown: Repo not found
Trying to pull registry.redhat.io/fedora...
unable to retrieve auth token: invalid username/password: unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials. Further instructions can be found here: https://access.redhat.com/RegistryAuthentication
Trying to pull docker.io/library/fedora...
Getting image source signatures
Copying blob ae7b613df528 done
Copying config b3048463dc done
Writing manifest to image destination
Storing signatures
b3048463dcefbe4920ef2ae1af43171c9695e2077f315b2bc12ed0f6f67c86c7
run
$ podman run --rm fedora /bin/echo "Hello Geeks! Welcome to Podman"
ps
$ podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
feb43e01e777 docker.io/library/ubuntu:latest bash 3 minutes ago Exited (139) 3 minutes ago magical_carson
inspect
$ podman inspect feb43e01e777
[
{
"Id": "feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac",
"Created": "2020-12-10T11:35:16.863809294Z",
"Path": "bash",
"Args": [
"bash"
],
"State": {
"OciVersion": "1.0.2-dev",
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 139,
"Error": "",
"StartedAt": "2020-12-10T11:35:17.280743295Z",
"FinishedAt": "2020-12-10T11:35:17.280874897Z",
"Healthcheck": {
"Status": "",
"FailingStreak": 0,
"Log": null
}
},
"Image": "f643c72bc25212974c16f3348b3a898b1ec1eb13ec1539e10a103e6e217eb2f1",
"ImageName": "docker.io/library/ubuntu:latest",
"Rootfs": "",
"Pod": "",
"ResolvConfPath": "/run/user/1000/containers/overlay-containers/feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac/userdata/resolv.conf",
"HostnamePath": "/run/user/1000/containers/overlay-containers/feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac/userdata/hostname",
"HostsPath": "/run/user/1000/containers/overlay-containers/feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac/userdata/hosts",
"StaticDir": "/home/brais/.local/share/containers/storage/overlay-containers/feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac/userdata",
"OCIConfigPath": "/home/brais/.local/share/containers/storage/overlay-containers/feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac/userdata/config.json",
"OCIRuntime": "runc",
"LogPath": "/home/brais/.local/share/containers/storage/overlay-containers/feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac/userdata/ctr.log",
"LogTag": "",
"ConmonPidFile": "/run/user/1000/containers/overlay-containers/feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac/userdata/conmon.pid",
"Name": "magical_carson",
"RestartCount": 0,
"Driver": "overlay",
"MountLabel": "system_u:object_r:container_file_t:s0:c375,c701",
"ProcessLabel": "system_u:system_r:container_t:s0:c375,c701",
"AppArmorProfile": "",
"EffectiveCaps": [
"CAP_AUDIT_WRITE",
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FOWNER",
"CAP_FSETID",
"CAP_KILL",
"CAP_MKNOD",
"CAP_NET_BIND_SERVICE",
"CAP_NET_RAW",
"CAP_SETFCAP",
"CAP_SETGID",
"CAP_SETPCAP",
"CAP_SETUID",
"CAP_SYS_CHROOT"
],
"BoundingCaps": [
"CAP_AUDIT_WRITE",
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FOWNER",
"CAP_FSETID",
"CAP_KILL",
"CAP_MKNOD",
"CAP_NET_BIND_SERVICE",
"CAP_NET_RAW",
"CAP_SETFCAP",
"CAP_SETGID",
"CAP_SETPCAP",
"CAP_SETUID",
"CAP_SYS_CHROOT"
],
"ExecIDs": [],
"GraphDriver": {
"Name": "overlay",
"Data": {
"LowerDir": "/home/brais/.local/share/containers/storage/overlay/6581dd55e4fe0935a32a688d74513db86632efb162fd41431e7d69318802dfae/diff:/home/brais/.local/share/containers/storage/overlay/1bd27dc7c1c2e7a36c599becda69d0cd905f4f1a122f2b7a95c81a78abc452ec/diff:/home/brais/.local/share/containers/storage/overlay/bacd3af13903e13a43fe87b6944acd1ff21024132aad6e74b4452d984fb1a99a/diff",
"UpperDir": "/home/brais/.local/share/containers/storage/overlay/ccc5801aaacb05d0ed1e64cee2e38f7b4dd8a29890e6fdf780887d296a1c9696/diff",
"WorkDir": "/home/brais/.local/share/containers/storage/overlay/ccc5801aaacb05d0ed1e64cee2e38f7b4dd8a29890e6fdf780887d296a1c9696/work"
}
},
"Mounts": [],
"Dependencies": [],
"NetworkSettings": {
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"Bridge": "",
"SandboxID": "",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": ""
},
"ExitCommand": [
"/usr/bin/podman",
"--root",
"/home/brais/.local/share/containers/storage",
"--runroot",
"/run/user/1000/containers",
"--log-level",
"error",
"--cgroup-manager",
"cgroupfs",
"--tmpdir",
"/run/user/1000/libpod/tmp",
"--runtime",
"runc",
"--storage-driver",
"overlay",
"--storage-opt",
"overlay.mount_program=/usr/bin/fuse-overlayfs",
"--events-backend",
"file",
"container",
"cleanup",
"feb43e01e7771ca0a5a1b4cdf5a7b2587341493f1ecd7b2723d1ad5a45076aac"
],
"Namespace": "",
"IsInfra": false,
"Config": {
"Hostname": "feb43e01e777",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": true,
"OpenStdin": true,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TERM=xterm",
"container=podman",
"HOSTNAME=feb43e01e777",
"HOME=/root"
],
"Cmd": [
"bash"
],
"Image": "docker.io/library/ubuntu:latest",
"Volumes": null,
"WorkingDir": "/",
"Entrypoint": "",
"OnBuild": null,
"Labels": null,
"Annotations": {
"io.container.manager": "libpod",
"io.kubernetes.cri-o.Created": "2020-12-10T11:35:16.863809294Z",
"io.kubernetes.cri-o.TTY": "true",
"io.podman.annotations.autoremove": "FALSE",
"io.podman.annotations.init": "FALSE",
"io.podman.annotations.privileged": "FALSE",
"io.podman.annotations.publish-all": "FALSE",
"org.opencontainers.image.stopSignal": "15"
},
"StopSignal": 15,
"CreateCommand": [
"podman",
"run",
"-it",
"ubuntu",
"bash"
]
},
"HostConfig": {
"Binds": [],
"CgroupMode": "host",
"ContainerIDFile": "",
"LogConfig": {
"Type": "k8s-file",
"Config": null
},
"NetworkMode": "slirp4netns",
"PortBindings": {},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": [],
"CapDrop": [],
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": [],
"GroupAdd": [],
"IpcMode": "private",
"Cgroup": "",
"Cgroups": "default",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "private",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [],
"Tmpfs": {},
"UTSMode": "private",
"UsernsMode": "",
"ShmSize": 65536000,
"Runtime": "oci",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": 0,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": [],
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
}
}
]
podman info
$ podman info
host:
arch: amd64
buildahVersion: 1.15.1
cgroupVersion: v1
conmon:
package: conmon-2.0.20-2.module_el8.3.0+475+c50ce30b.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.0.20, commit: 1019ecdeda3936be22162bb1cca308192145de53'
cpus: 2
distribution:
distribution: '"centos"'
version: "8"
eventLogger: file
hostname: vm-test1
idMappings:
gidmap:
- container_id: 0
host_id: 1000
size: 1
- container_id: 1
host_id: 100000
size: 65536
uidmap:
- container_id: 0
host_id: 1000
size: 1
- container_id: 1
host_id: 100000
size: 65536
kernel: 4.18.0-193.28.1.el8_2.x86_64
linkmode: dynamic
memFree: 247398400
memTotal: 4129382400
ociRuntime:
name: runc
package: runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
path: /usr/bin/runc
version: 'runc version spec: 1.0.2-dev'
os: linux
remoteSocket:
path: /run/user/1000/podman/podman.sock
rootless: true
slirp4netns:
executable: /usr/bin/slirp4netns
package: slirp4netns-1.1.4-2.module_el8.3.0+475+c50ce30b.x86_64
version: |-
slirp4netns version 1.1.4
commit: b66ffa8e262507e37fca689822d23430f3357fe8
libslirp: 4.3.1
SLIRP_CONFIG_VERSION_MAX: 3
swapFree: 0
swapTotal: 0
uptime: 17h 48m 18.07s (Approximately 0.71 days)
registries:
search:
- registry.access.redhat.com
- registry.redhat.io
- docker.io
store:
configFile: /home/brais/.config/containers/storage.conf
containerStore:
number: 1
paused: 0
running: 0
stopped: 1
graphDriverName: overlay
graphOptions:
overlay.mount_program:
Executable: /usr/bin/fuse-overlayfs
Package: fuse-overlayfs-1.1.2-3.module_el8.3.0+507+aa0970ae.x86_64
Version: |-
fuse-overlayfs: version 1.1.0
FUSE library version 3.2.1
using FUSE kernel interface version 7.26
graphRoot: /home/brais/.local/share/containers/storage
graphStatus:
Backing Filesystem: xfs
Native Overlay Diff: "false"
Supports d_type: "true"
Using metacopy: "false"
imageStore:
number: 8
runRoot: /run/user/1000/containers
volumePath: /home/brais/.local/share/containers/storage/volumes
version:
APIVersion: 1
Built: 1600970293
BuiltTime: Thu Sep 24 17:58:13 2020
GitCommit: ""
GoVersion: go1.14.7
OsArch: linux/amd64
Version: 2.0.5

How to get the Social preview of a github project?

I could get the project, but it does not retrieve the Social Preview of the project:
The link that I'm using is this one:
https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD
which is returning the following:
{
"id": 215636067,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTU2MzYwNjc=",
"name": "BCMIC-PHD",
"full_name": "AngelRibeiro10/BCMIC-PHD",
"private": false,
"owner": {
"login": "AngelRibeiro10",
"id": 13433634,
"node_id": "MDQ6VXNlcjEzNDMzNjM0",
"avatar_url": "https://avatars2.githubusercontent.com/u/13433634?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AngelRibeiro10",
"html_url": "https://github.com/AngelRibeiro10",
"followers_url": "https://api.github.com/users/AngelRibeiro10/followers",
"following_url": "https://api.github.com/users/AngelRibeiro10/following{/other_user}",
"gists_url": "https://api.github.com/users/AngelRibeiro10/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AngelRibeiro10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AngelRibeiro10/subscriptions",
"organizations_url": "https://api.github.com/users/AngelRibeiro10/orgs",
"repos_url": "https://api.github.com/users/AngelRibeiro10/repos",
"events_url": "https://api.github.com/users/AngelRibeiro10/events{/privacy}",
"received_events_url": "https://api.github.com/users/AngelRibeiro10/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/AngelRibeiro10/BCMIC-PHD",
"description": "This is a Brain-Computer Music Interfacing Project",
"fork": false,
"url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD",
"forks_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/forks",
"keys_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/teams",
"hooks_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/hooks",
"issue_events_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues/events{/number}",
"events_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/events",
"assignees_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/assignees{/user}",
"branches_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/branches{/branch}",
"tags_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/tags",
"blobs_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/statuses/{sha}",
"languages_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/languages",
"stargazers_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/stargazers",
"contributors_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/contributors",
"subscribers_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/subscribers",
"subscription_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/subscription",
"commits_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/contents/{+path}",
"compare_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/merges",
"archive_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/downloads",
"issues_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues{/number}",
"pulls_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/pulls{/number}",
"milestones_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/milestones{/number}",
"notifications_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/labels{/name}",
"releases_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/releases{/id}",
"deployments_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/deployments",
"created_at": "2019-10-16T20:14:22Z",
"updated_at": "2019-11-14T16:52:13Z",
"pushed_at": "2019-11-14T16:52:11Z",
"git_url": "git://github.com/AngelRibeiro10/BCMIC-PHD.git",
"ssh_url": "git#github.com:AngelRibeiro10/BCMIC-PHD.git",
"clone_url": "https://github.com/AngelRibeiro10/BCMIC-PHD.git",
"svn_url": "https://github.com/AngelRibeiro10/BCMIC-PHD",
"homepage": null,
"size": 69612,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": {
"key": "apache-2.0",
"name": "Apache License 2.0",
"spdx_id": "Apache-2.0",
"url": "https://api.github.com/licenses/apache-2.0",
"node_id": "MDc6TGljZW5zZTI="
},
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"temp_clone_token": null,
"network_count": 0,
"subscribers_count": 1
}
I want to get this picture of 'Social Preview' ... but it doent show in the returning of the project atributes.
Thank you very much :)
So it's not possible to retrieve it from the API, but in my case since I only displayed my top three repos on my website it wasn't a pain to manually grab the image URLs.
I did this by uploading the preview image on GitHub, then right click on the image when it pops up -> inspect and you'll see in the developer tools the element has a 'background-image: url()' property, right click on that URL and then open in new tab, and there's the URL for your image!
Like I said, it's a manual process but if you need to only do it a few times then it's not a huge deal. That was my workaround.

Exception when running in docker: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "hamzabelmellouki"

I am pretty new to docker. I have a spring-boot application that connects to postgres database (running in a container). I want to dockerize my spring-boot application and be able to connect it to the postgres database container.
What works:
Running the application without using docker works just fine: java -jar product-manager-0.0.1-SNAPSHOT.jar
What doesn't work:
Dockerizing and Running the application with Docker gives me an exception.
Note that I am not using docker-compose here.
My app Dockerfile:
FROM openjdk:11
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
Steps I've taken to run the app:
Run and start up the postgres database in a container using these commands:
docker run --rm --name lil-postgres -e POSTGRES_PASSWORD=password -d -v $HOME/srv/postgres:/var/lib/postgresql/data -p 5432:5432 postgres
postgres -D /usr/local/var/postgres
I've built the app's image:
docker build -t ensa/product-manager .
This is the result from running the latest command:
Sending build context to Docker daemon 38.01MB
Step 1/4 : FROM openjdk:11
---> 612d4d483eee
Step 2/4 : ARG JAR_FILE=target/*.jar
---> Running in 1b8674e959ca
Removing intermediate container 1b8674e959ca
---> d2c2b90680de
Step 3/4 : COPY ${JAR_FILE} app.jar
---> 01295beecd1b
Step 4/4 : ENTRYPOINT ["java","-jar","/app.jar"]
---> Running in 31230e7ff323
Removing intermediate container 31230e7ff323
---> c4487683e7b1
Successfully built c4487683e7b1
Successfully tagged ensa/product-manager:latest
Finally, I've created a running container using:
docker run --net="host" -it ensa/product-manager
The third step resulted in an exception:
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "hamzabelmellouki"
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:520) ~[postgresql-42.2.8.jar!/:42.2.8]
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141) ~[postgresql-42.2.8.jar!/:42.2.8]
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192) ~[postgresql-42.2.8.jar!/:42.2.8]
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.8.jar!/:42.2.8]
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195) ~[postgresql-42.2.8.jar!/:42.2.8]
at org.postgresql.Driver.makeConnection(Driver.java:458) ~[postgresql-42.2.8.jar!/:42.2.8]
at org.postgresql.Driver.connect(Driver.java:260) ~[postgresql-42.2.8.jar!/:42.2.8]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-3.4.1.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353) ~[HikariCP-3.4.1.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-3.4.1.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) ~[HikariCP-3.4.1.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562) ~[HikariCP-3.4.1.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-3.4.1.jar!/:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-3.4.1.jar!/:na]
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158) ~[spring-jdbc-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116) ~[spring-jdbc-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79) ~[spring-jdbc-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:324) ~[spring-jdbc-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:120) ~[spring-boot-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateDefaultDdlAutoProvider.getDefaultDdlAuto(HibernateDefaultDdlAutoProvider.java:42) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.lambda$getVendorProperties$1(HibernateJpaConfiguration.java:130) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings.getDdlAuto(HibernateSettings.java:41) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.determineDdlAuto(HibernateProperties.java:136) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.getAdditionalProperties(HibernateProperties.java:102) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.determineHibernateProperties(HibernateProperties.java:94) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.getVendorProperties(HibernateJpaConfiguration.java:132) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.entityManagerFactory(JpaBaseConfiguration.java:133) ~[spring-boot-autoconfigure-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:640) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:625) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108) ~[spring-context-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ~[spring-context-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at com.ensa.productmanager.ProductManagerApplication.main(ProductManagerApplication.java:10) ~[classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[app.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[app.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) ~[app.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) ~[app.jar:0.0.1-SNAPSHOT]
I've spent the whole day debugging and reading threads about this error. But I couldn't find a clue. Any help will be much appreciated.
UPDATE
I've run docker inspect on the Postgres container:
[
{
"Id": "426744f8c0a90b504c4d7c22242929f4b7f833e3ff4ddb9a112139d18ffd7c10",
"Created": "2020-01-16T19:14:14.7290504Z",
"Path": "docker-entrypoint.sh",
"Args": [
"postgres"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 8057,
"ExitCode": 0,
"Error": "",
"StartedAt": "2020-01-16T19:14:15.5451891Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:e2d75d1c1264a777df31dcbd4fd452b238134eb27854c2a173fdbfaa47ce9b87",
"ResolvConfPath": "/var/lib/docker/containers/426744f8c0a90b504c4d7c22242929f4b7f833e3ff4ddb9a112139d18ffd7c10/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/426744f8c0a90b504c4d7c22242929f4b7f833e3ff4ddb9a112139d18ffd7c10/hostname",
"HostsPath": "/var/lib/docker/containers/426744f8c0a90b504c4d7c22242929f4b7f833e3ff4ddb9a112139d18ffd7c10/hosts",
"LogPath": "/var/lib/docker/containers/426744f8c0a90b504c4d7c22242929f4b7f833e3ff4ddb9a112139d18ffd7c10/426744f8c0a90b504c4d7c22242929f4b7f833e3ff4ddb9a112139d18ffd7c10-json.log",
"Name": "/lil-postgres",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/Users/hamzabelmellouki/srv/postgres:/var/lib/postgresql/data"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"5432/tcp": [
{
"HostIp": "",
"HostPort": "5432"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": true,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Capabilities": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/baabe07f985a61979a3752f7e3c43116b980c45682d27c660b2867a6af3da28b-init/diff:/var/lib/docker/overlay2/ac6700580b74ace6c2f4eb9c274ef405124afb8019948c51516b496ed62eae8d/diff:/var/lib/docker/overlay2/35c484f8059617661ae54f749d0b938e7d81bc2089dd81ef81952aed6079c30b/diff:/var/lib/docker/overlay2/1649505946cf497fd95a5b7a118150a09315767464671f93459e3324f8e5ac42/diff:/var/lib/docker/overlay2/69a4818765c800f405e11c7755e184e4fd0837b68b4664821cf9c80daa7b629b/diff:/var/lib/docker/overlay2/177d3596510c3fdb235ec84728b8b6baf23a406dca3e9a3bfb45e98b48fe2395/diff:/var/lib/docker/overlay2/07d15f6f98f43ff88e6bdf9e361fadaaa46f83121278b5dbddac372cb95d99b8/diff:/var/lib/docker/overlay2/5e10c2001ef13459900f124ae825c210e2e001b0aa2f8b5e1e7c8c5c27d9e403/diff:/var/lib/docker/overlay2/b1e7828ebe991a7401746f581fd640bca3ae74f3a9820fd15e0fb2c666a08754/diff:/var/lib/docker/overlay2/e1b274467493537d29e25cce71acf9c3020d8a2e25080c75aa0fca10a5c05789/diff:/var/lib/docker/overlay2/11141fed542b6c519ec7621e0c4f341d2b2822a7c2885980216a2ef27609ffe0/diff:/var/lib/docker/overlay2/c3e4e9634bfe6a9e4b26f3d2d5751b2fa01aae0e8e1679a800accd94179d527d/diff:/var/lib/docker/overlay2/e7da8a834521c827046a2dc64f6f39afa6fded7f1af3241c75c592756d3053d6/diff:/var/lib/docker/overlay2/91d22f9b7d3aa1fae5cabcfe245a18c7dc6ac372696c73be70b65f7c8b42f1f4/diff:/var/lib/docker/overlay2/1a2021467ef42428eda11a9aef133e4b7ee9364266255abe5a0f2df4a9ff2584/diff",
"MergedDir": "/var/lib/docker/overlay2/baabe07f985a61979a3752f7e3c43116b980c45682d27c660b2867a6af3da28b/merged",
"UpperDir": "/var/lib/docker/overlay2/baabe07f985a61979a3752f7e3c43116b980c45682d27c660b2867a6af3da28b/diff",
"WorkDir": "/var/lib/docker/overlay2/baabe07f985a61979a3752f7e3c43116b980c45682d27c660b2867a6af3da28b/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/Users/hamzabelmellouki/srv/postgres",
"Destination": "/var/lib/postgresql/data",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "426744f8c0a9",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"5432/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"POSTGRES_USER=hamzabelmellouki",
"POSTGRES_PASSWORD=password",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/11/bin",
"GOSU_VERSION=1.11",
"LANG=en_US.utf8",
"PG_MAJOR=11",
"PG_VERSION=11.5-1.pgdg90+1",
"PGDATA=/var/lib/postgresql/data"
],
"Cmd": [
"postgres"
],
"Image": "postgres",
"Volumes": {
"/var/lib/postgresql/data": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "2649b309ebde1f690927a1081497c9dc05dc249642b429f25d930243eb81e08f",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"5432/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "5432"
}
]
},
"SandboxKey": "/var/run/docker/netns/2649b309ebde",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "f01f60128018d8634f26a0c683ee6865e20361548b3a49007804dc913bfc4292",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "045d48c0f1d22cb7c319d6e850f6e9985a08e6d08884a79e823dbd0ac6c8a1b9",
"EndpointID": "f01f60128018d8634f26a0c683ee6865e20361548b3a49007804dc913bfc4292",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
]
maybe,you can use docker-compose to defining and running multi-container docker applications(postgres+spring-boot) and you use a YAML file to configure your application's services.
So,You must create new volumes with different path to insert new data with new schema and configuration,because if you use volumes that already used before so you will find the problems like password authentication failed for user “hamzabelmellouki”
or the user(role) “hamzabelmellouki” does not existe or the database "database's name" does not existe because they have other user rhat created before .
#####docker-compose.yml#####
version: '3'
services:
db:
image: postgres
container_name: lil-postgres
ports:
- "5432:5432"
restart: unless-stopped
volumes:
- "./postgres/data:/var/lib/postgresql/data"
environment:
POSTGRES_USER: hamzabelmellouki
POSTGRES_PASSWORD: password
POSTGRES_DB: hamzabelmellouki
networks:
- product-net
product:
image: ensa/product-manager
restart: unless-stopped
ports:
- "8080:8080"
depends_on:
- db
networks:
- product-net
networks:
product-net:
driver: bridge
volumes:
db:
driver: local
Try below:
While running Postgres container, you have not provided any username , it should be something like:
docker run --rm --net="host" --name lil-postgres -e POSTGRES_USER=hamzabelmellouki -e POSTGRES_PASSWORD=password -d -v $HOME/srv/postgres:/var/lib/postgresql/data -p 5432:5432 postgres:9.6
by default Postgres container will run in bridge network (default docker network) and in your app, you've provided --net="host"
So maybe due to that, they are not able to communicate.
Provide the same network while running both
You can check it by below command
docker inspect container_name (or container_id)
Its nothing related, still, I've updated the docker image tag(Postgres:9.6), as it's always good to use a particular tag name, instead of default one (latest tag).
Try changing localhost by the ip adresse 172.17.0.2 in the application.properties spring.datasource.url=jdbc:postgresql://172.17.0.2:5432/testdb

get json key value using powershell

I have the following json output string:
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 1
},
"objects": [{
"bcontext": "/api/v2.0/buildercontext/2/",
"bugs": [],
"build": {
"bldtype": "obj",
"branch": "main",
"buildstatus": [{
"build": "/api/v2.0/build/2140634/",
"failurereason": "_checkfailures (seen: FAIL - /testrun/18647678/ - area[4769] AIM-SANITY)",
"id": "1294397",
"lastupdate": "2015-03-31T14:30:18",
"overridden": false,
"overridedesc": "",
"overrideuser": null,
"recommended": false,
"resource_uri": "/api/v2.0/buildstatus/1294397/",
"slatype": {
"id": "26",
"name": "VA_Bats",
"resource_uri": "/api/v2.0/sla/26/"
}
}],
"changeset": "494625",
"coverage": false,
"deliverables": ["/api/v2.0/deliverable/4296455/", "/api/v2.0/deliverable/4296956/", "/api/v2.0/deliverable/4296959/", "/api/v2.0/deliverable/4296986/", "/api/v2.0/deliverable/4296992/", "/api/v2.0/deliverable/4296995/", "/api/v2.0/deliverable/4297034/", "/api/v2.0/deliverable/4297058/"],
"git_host": null,
"git_repo": null,
"id": "2140634",
"p4host": {
"id": "10",
"p4port": "perforce-rhino.eng.com:1800",
"p4weburl": "http://p4web.eng.com:1800",
"resource_uri": "/api/v2.0/perforceserver/10/"
},
"resource_uri": "/api/v2.0/build/2140634/",
"site": "/api/v2.0/site/25/",
"site_name": "mbu",
"slastested": ["/api/v2.0/sla/26/"],
"submit_time": "2015-03-31T05:40:21",
"submit_user": "haharonof"
},
"builder": "/api/v2.0/builder/1423/",
"clean": true,
"componentbuilds": "vcops-vsphere-solution-pak=sb-5242047,vrops=sb-5242013,vscm=sb-5242025,vsutilities=sb-5242029;parentbuilder=1410",
"deleted": false,
"endtime": "2015-03-31T06:20:58",
"helpzillas": [],
"id": "4296956",
"location": {
"httpserver": "sc-prd-cat-services001.eng.com",
"id": "1",
"name": "PA",
"nfsserver": "cat-results.eng.com",
"pxedir": "/mts/builder-pxe",
"resource_uri": "/api/v2.0/location/1/",
"resultspath": "/results"
},
"nfsserver": "build-storage60",
"p4client": "vmktestdevnanny-builder-1423",
"path": "/storage60/release/sb-5242148",
"ready": true,
"resource_uri": "/api/v2.0/deliverable/4296956/",
"result": "PASS",
"sbbuildid": 5242148,
"sbjobid": 5242148,
"sbuser": "arajamanickam",
"starttime": "2015-03-31T06:16:50",
"targetchangeset": "494625",
"targets": "vcopssuitevm",
"triagetime": null,
"vmodl": null
}]
}
I want to get sbbuildid using powershell. How can I get this?
By converting your json to an object, using the ConvertFrom-Json cmdlet (assuming $jsonString contains the json above):
$jsonObj = $jsonString | ConvertFrom-Json
$jsonObj.objects.sbbuildid
$sb_build_id = $build_info.Substring($build_info.IndexOf("sbbuildid") + 11, 8).trim()
Put whole string in $build_info