Line 260: *0: syntax error: operand expected (error token is "*0")

I had seen a previous thread as well, but it doesn’t provide a solution. So, I’m opening a new one.

I got this installing discourse on arm64 arch, linux ubuntu on aws.

./discourse-setup: line 260: *0: syntax error: operand expected (error token is “*0”)

Hostname for your Discourse? [discourse.example.com]:

Can you please paste the output of

cat /proc/cpuinfo

The failing line is the one which aims to calculate the number of physical CPU cores

1 Like

Thank you for your reply. The following is the data you requested.

processor : 0
BogoMIPS : 243.75
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x3
CPU part : 0xd0c
CPU revision : 1
processor : 1
BogoMIPS : 243.75
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x3
CPU part : 0xd0c
CPU revision : 1

I have 2 vCPUs (if that information relevant)

Thanks. For your immediate purposes, I’d suggest you edit line 260 and rerun. Probably to

avail_cores=2 # $((`awk '/cpu cores/ {print $4;exit}' /proc/cpuinfo`*`sort /proc/cpuinfo | uniq | grep -c "physical id"`))

But it looks like the script needs a fix to deal with AArch64 cloud offerings.

Please could you paste the output of

lscpu

or indeed

lscpu -p
1 Like

I will try that fix. But still I can wait for a proper fix as well.

Here’s the lscpu output

Architecture:           aarch64
  CPU op-mode(s):       32-bit, 64-bit
  Byte Order:           Little Endian
CPU(s):                 2
  On-line CPU(s) list:  0,1
Vendor ID:              ARM
  Model name:           Neoverse-N1
    Model:              1
    Thread(s) per core: 1
    Core(s) per socket: 2
    Socket(s):          1
    Stepping:           r3p1
    BogoMIPS:           243.75
    Flags:              fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp 
                        asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
Caches (sum of all):    
  L1d:                  128 KiB (2 instances)
  L1i:                  128 KiB (2 instances)
  L2:                   2 MiB (2 instances)
  L3:                   32 MiB (1 instance)
NUMA:                   
  NUMA node(s):         1
  NUMA node0 CPU(s):    0,1
Vulnerabilities:        
  Gather data sampling: Not affected
  Itlb multihit:        Not affected
  L1tf:                 Not affected
  Mds:                  Not affected
  Meltdown:             Not affected
  Mmio stale data:      Not affected
  Retbleed:             Not affected
  Spec rstack overflow: Not affected
  Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:           Mitigation; __user pointer sanitization
  Spectre v2:           Mitigation; CSV2, BHB
  Srbds:                Not affected
  Tsx async abort:      Not affected

Bizarrely, I previously submitted a PR to fix this, it was (eventually) merged, and yet I don’t see the fix in the current version.

Ah, I see it was merged to ‘master’ and not to ‘main’. That sounds like a problem!

This was the fixed line

    avail_cores=`lscpu --parse=core | egrep -v ^# | sort -u | wc -l`
2 Likes

Thanks a lot :slight_smile: . Now it works.

2 Likes

PR submitted

3 Likes

Thank you for taking prompt actions :slight_smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.